我尝试插入自己的程序作为启动序列的一部分。 在 / 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#
所以有两个问题: