日期:2014-05-16  浏览次数:20611 次

Linux下使用chkconfig设置自启动脚本

转载自:http://www.blogjava.net/idkkk/archive/2007/11/26/163094.html

?

?

Linux下使用chkconfig设置自启动脚本

(以配置自启动Tomcat为例子)
1) 在/etc/rc.d/init.d/下新建startTomcat,添加如下内容:
#!/bin/sh
# chkconfig: 345 63 37
# description: tomcat server init script
su - root -c '/usr/local/tomcat/bin/startup.sh'

2) 修改文件属性为可以执行权限
#chmod 755 startTomcat

3) 配置脚本
#chkconfig --level 345 startTomcat on

?