4

在 /etc/init.d/myservice 脚本中,我有以下几行

### BEGIN INIT INFO
# Provides: myserviced
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description: Bring up/down service
### END INIT INFO

尽管如此,在执行命令 **/sbin/chkconfig --add myserviced 时省略了以下错误消息

insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
insserv: script jexec is broken: incomplete LSB comment.
insserv: missing `Required-Stop:'  entry: please add even if empty.
myserviced          0:off  1:off  2:off  3:on   4:off  5:on   6:off

我读过帖子不完整的 LSB 评论。insserv:缺少“提供:”的有效名称,请添加。但没有任何帮助。

此错误发生在 SUSE 11 而不是 Rehat-6

4

2 回答 2

11

确保您的破折号是预期的。在我正在做的一些复制粘贴中,解释器没有看到预期的字符。所以从字面上看,这

# Required­Start:    $remote_fs $syslog $time 
# Required­Stop:     $remote_fs $syslog $time 
# Should­Start:      $network $named slapd autofs ypbind nscd nslcd 
# Should­Stop:       $network $named slapd autofs ypbind nscd nslcd 

变成了这样:

# Required-­Start:    $remote_fs $syslog $time 
# Required­-Stop:     $remote_fs $syslog $time 
# Should­-Start:      $network $named slapd autofs ypbind nscd nslcd 
# Should-­Stop:       $network $named slapd autofs ypbind nscd nslcd 

我从包含明显不可打印字符的 pdf 中复制的第一组。我手动输入 - 并且它有效。

于 2015-07-28T12:33:50.833 回答
0

jexec 中的错误不是 myservice 它在 SLED 11 SP2 中仍然存在 您必须将 Required-Stop 行添加到 jexec

于 2015-04-04T09:08:25.270 回答