使用
chkconfig
开机启动运行自己写的脚本
1.将脚本放到/etc/init.d/目录下,否则会报下面的错误
error reading information on service scriptname: No such file or directory
2.脚中必须有下的内容
# chkconfig: 2345 20 80
# description: Your script. description \
# You can use \ add multi-line comment
如果没有这两行在chkconfig scriptname on或chkconfig –add scriptname会报下的错误:
service scriptname does not support chkconfig
3. 关于# chkconfig: 2345 20 80
2345:脚本在那本启动level运行,如果是any level,可以指定为-
20:系统启动脚本运行优先级
80:系统关闭脚本运行优先级
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7419833/viewspace-520913/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7419833/viewspace-520913/