2013-05-15 132 views
1

我有以下腳本來啓動,停止,重新啓動的Apache2在我的Debian 7阿帕奇的init.d腳本

#!/bin/sh 
### BEGIN INIT INFO 
# Provides:   apache2 
# Required-Start: $all 
# Required-Stop:  $all 
# Default-Start:  2 3 4 5 
# Default-Stop:  0 1 6 
# Short-Description: apache2 
# Description: Start apache2 
### END INIT INFO 

case "$1" in 
start) 
     echo "Starting Apache ..." 
     # Change the location to your specific location 
     /usr/local/apache2/bin/apachectl start 
;; 
stop) 
     echo "Stopping Apache ..." 
     # Change the location to your specific location 
     /usr/local/apache2/bin/apachectl stop 
;; 
graceful) 
     echo "Restarting Apache gracefully..." 
     # Change the location to your specific location 
     /usr/local/apache2/bin/apachectl graceful 
;; 
restart) 
     echo "Restarting Apache ..." 
     # Change the location to your specific location 
     /usr/local/apache2/bin/apachectl restart 
;; 
*) 
     echo "Usage: '$0' {start|stop|restart|graceful}" 
     exit 64 
;; 
esac 
exit 0 

當我添加腳本來更新-rc.d中我看到下面的警告:

[email protected]:/etc/init.d# update-rc.d apache2 defaults 
update-rc.d: using dependency based boot sequencing 
insserv: Script jexec is broken: incomplete LSB comment. 
insserv: missing `Required-Stop:' entry: please add even if empty. 
insserv: missing `Default-Stop:' entry: please add even if empty. 
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `jexec' 

但是我已經在腳本中添加了Required-Stop和Default-Stop。

有誰知道如何解決這個問題?

回答

0

這個問題不在你的apache2初始化腳本中,它在'jexec'中表示'腳本jexec壞了'。

,一個是缺少所需的停車和默認,停止

對我的SLES Boxen有同樣的問題。不要擔心,即使它顯示你這些錯誤,一切仍然運行良好!

HTH