首页 > Ubuntu/Debian操作系统 > debian6开机启动脚本的方法

debian6开机启动脚本的方法

2015年10月18日

debian6开机启动脚本的方法
http://www.blogjava.net/ivanwan/archive/2013/09/29/404613.html
在debian6中,加入开机启动脚本的方法与debian5不同了,直接做符号链接到runlevel已经不起作用了,提示缺少LSB信息,并且用insserv来替代update-rc.d:

[email protected]:/etc/rc2.d# update-rc.d -n php_fastcgi.sh defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script ‘K02php_fastcgi’ missing LSB tags and overrides
insserv: warning: script ‘K01php_fastcgi.sh’ missing LSB tags and overrides
insserv: warning: script ‘php_fastcgi.sh’ missing LSB tags and overrides
insserv: warning: current start runlevel(s) (empty) of script `php_fastcgi.sh’ overwrites defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0) of script `php_fastcgi.sh’ overwrites defaults (0 1 6).
insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop
# insserv /etc/init.d/php_fastcgi.sh
insserv: warning: script ‘K02php_fastcgi’ missing LSB tags and overrides
insserv: warning: script ‘php_fastcgi.sh’ missing LSB tags and overrides

debian6中将脚本加入到开机启动的方法:

在脚本中加入LSB描述信息。
[email protected]:~# more /etc/init.d/php_fastcgi.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: php_fastcgi.sh
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the php_fastcgi daemon
# Description: starts php_fastcgi using start-stop-daemon
### END INIT INFO

安装启动脚本到system init script。
[email protected]:~# insserv -v -d /etc/init.d/php_fastcgi.sh

重启机器试试吧。

本文的评论功能被关闭了.