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
posted on 2007-11-26 10:47 Kevin Xia 閱讀(1772) 評論(0) 編輯 收藏 所屬分類: 開源技術