【问题标题】:Apache init.d scriptApache init.d 脚本
【发布时间】:2013-05-09 11:52:30
【问题描述】:

我有以下脚本在我的 debian 7 中启动、停止、重新启动 apache2

#!/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

当我将脚本添加到 update-rc.d 时,我看到以下警告:

root@pomelo:/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。

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: service debian init.d


    【解决方案1】:

    问题不在您的 apache2 初始化脚本中,而在“jexec”中,它说“脚本 jexec 已损坏”。

    那个缺少Required-Stop和Default-Stop

    在我的 SLES boxen 上遇到了同样的问题。不过不用担心,即使它向您显示这些错误,一切仍然运行良好!

    HTH

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-29
      • 2011-04-05
      • 1970-01-01
      • 2013-07-23
      • 1970-01-01
      • 2011-04-28
      • 2014-10-19
      • 2016-10-16
      相关资源
      最近更新 更多