vi /etc/rc.d/rc.local
比如要将tomcat添加为开机自启动就在最后加上 /usr/local/soft/tomcat/bin/start.sh
Chmod 777 /etc/rc.d/rc.local