insserv:缺少`Required-Stop:'条目:即使为空也请添加

Posted

技术标签:

【中文标题】insserv:缺少`Required-Stop:\'条目:即使为空也请添加【英文标题】:insserv: missing `Required-Stop:' entry: please add even if emptyinsserv:缺少`Required-Stop:'条目:即使为空也请添加 【发布时间】:2015-04-20 22:20:57 【问题描述】:

在 /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

我已经阅读了Incomplete LSB comment. insserv: missing valid name for `Provides:' please add 的帖子。但没有任何帮助。

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

【问题讨论】:

【参考方案1】:

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

# 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 中复制的第一组。我手动输入了 - 并且成功了。

【讨论】:

这为我解决了,应该标记为答案。 我可能在 nano 中看到正确,但 Leafpad 显示它是错误的。【参考方案2】:

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

【讨论】:

如果你可以编辑发布的问题并展示如何做会更好 @gluten3 在原始问题中,您可以看到“Required-Stop”行存在,但 jexec 仍然会引发警告。您能否发布一些可以修复显示警告的示例模板。

以上是关于insserv:缺少`Required-Stop:'条目:即使为空也请添加的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu twemproxy 服务编写

nginx1.10.0启动脚本

ubuntu redis 自启动配置文件

node_exporter.sh

树莓派(jessie)制作服务并开机启动

Linux将ActiveMQ修改为自启动