update-rc.d remove - > insserv:服务之间有一个循环

时间:2018-01-25 11:15:24

标签: linux init.d

我尝试插入自己的程序作为启动序列的一部分。 在 / etc / fstab 文件中定义安装磁盘之前,应该调用此脚本( dudriver )。

/etc/init.d/dudriver:

#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi

### BEGIN INIT INFO
# Provides:          dudriver
# Required-Start:    $network $named
# Required-Stop:     umountfs
# Should-Start:      udev
# Should-Stop:       udev
# X-Start-Before:    mountall
# X-Stop-After:      umountfs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: 
# Description:
### END INIT INFO


if [ -x /opt/dudriver_startup.sh ]
then
        /opt/dudriver_startup.sh >>/var/log/dudriver_startup.log
fi

exit 0

在编辑 dudriver 脚本的一些迭代之后,我收到如下错误消息:

root@sysman:/etc/init.d# update-rc.d dudriver remove
insserv: There is a loop between service umountfs and dudriver if stopped
insserv:  loop involving service dudriver at depth 3
insserv:  loop involving service umountfs at depth 2
insserv:  loop involving service postgresql at depth 1
insserv:  loop involving service cryptdisks at depth 4
insserv:  loop involving service networking at depth 2
insserv: There is a loop between service umountfs and dudriver if stopped
insserv:  loop involving service umountnfs at depth 3
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header


root@sysman:/etc/init.d# update-rc.d dudriver defaults
insserv: There is a loop between service umountfs and dudriver if stopped
insserv:  loop involving service dudriver at depth 3
insserv:  loop involving service umountfs at depth 2
insserv:  loop involving service postgresql at depth 1
insserv:  loop involving service cryptdisks at depth 4
insserv:  loop involving service networking at depth 2
insserv: There is a loop between service umountfs and dudriver if stopped
insserv:  loop involving service umountnfs at depth 3
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
root@sysman:/etc/init.d# 

所以有两个问题:

  1. 如何解决"之间的"循环问题?
  2. 如何在安装驱动器之前正确描述LSB标头以调用dudriver脚本?
  3. PS:uname -a Linux sysman 4.13.0-31-generic#34~16.04.1-Ubuntu SMP Fri Jan 19 17:11:01 UTC 2018 x86_64 x86_64 x86_64 GNU / Linux

0 个答案:

没有答案