[Pkg-sysvinit-devel] Can't get the boot order correct

Turbo Fredriksson turbo at bayour.com
Wed May 6 11:46:00 UTC 2015


I'm not sure if update-rc.d with insserv is still supported (still running Wheezy),
but here goes:

I'm the maintainer for ZFS On Linux FOR ZFS On Linux (I'm making the packages for
ZoL provided in the ZoL archives - hopefully I can provide some help to get it
in Debian GNU/Linux now that it seems the lawyers have come back with "something").

But I can't get the boot (or rather shutdown/reboot) order correctly!

These are the LSB headers in the files:

* zfs-import
	### BEGIN INIT INFO
	# Provides:          zfs-import zpool
	# Required-Start:    $local_fs zfs-zed
	# Required-Stop:     $local_fs
	# Default-Start:     S
	# Default-Stop:      0 1 6
	# X-Stop-After:      zfs-mount
	# Short-Description: Import ZFS pools
	# Description: Run the `zpool import` or `zpool export` commands.
	### END INIT INFO

* zfs-mount
	### BEGIN INIT INFO
	# Provides:          zvol zfs zfs-mount
	# Required-Start:    $local_fs zfs-import
	# Required-Stop:     $local_fs
	# Default-Start:     2 3 4 5
	# Default-Stop:      0 1 6
	# X-Stop-After:      zfs-share
	# Short-Description: Mount ZFS filesystems and volumes
	# Description: Run the `zfs mount -a` or `zfs umount -a` commands.
	### END INIT INFO

* zfs-share
	### BEGIN INIT INFO
	# Provides:          shareiscsi sharenfs sharesmb zfs-share
	# Required-Start:    $local_fs $network $remote_fs zfs-mount
	# Required-Stop:     $local_fs $network $remote_fs
	# Default-Start:     2 3 4 5
	# Default-Stop:      0 1 6
	# Should-Start:      iscsi iscsitarget istgt scst @NFS_SRV@ samba samba4 zfs-mount
	# Should-Stop:       iscsi iscsitarget istgt scst @NFS_SRV@ samba samba4 zfs-mount
	# Short-Description: Network share ZFS datasets and volumes.
	# Description:       Run the `zfs share -a` or `zfs unshare -a` commands
	#                    for controlling iSCSI, NFS, or CIFS network shares.
	### END INIT INFO

* zfs-zed
	### BEGIN INIT INFO
	# Provides:          zed zeventd zfs-zed
	# Required-Start:    $local_fs
	# Required-Stop:     $local_fs
	# Default-Start:     S
	# Default-Stop:      0 1 6
	# X-Stop-After:      zfs-import
	# Short-Description: ZFS Event Daemon
	# Description:       zed monitors ZFS events. When a zevent is posted, zed
	#                    will run any scripts that have been enabled for the
	#                    corresponding zevent class.
	### END INIT INFO

My INTENTION is to have them started in this order:

	1. zfs-zed
	2. zfs-import
	3. zfs-mount
	4. zfs-share

and stopped in the reverse order. I create the links with update-rc.d like this:

	update-rc.d zfs-zed    start 18 S .       stop 08 0 1 6 .
	update-rc.d zfs-import start 11 S .       stop 07 0 1 6 .
	update-rc.d zfs-mount  start 02 2 3 4 5 . stop 06 0 1 6 .
	update-rc.d zfs-share  start 03 2 3 4 5 . stop 05 0 1 6 .

The boot up works fine, but not the stop/reboot. It stopped in this order
instead:

	1. zfs-import
	2. zfs-mount
	3. zfs-share
	4. zfs-zed

This is incorrect (zfs-import and zfs-share should change places). The K links
look ok (and works as intended if creating the  /etc/init.d/.legacy-bootordering
file):

	# find /etc/rc?.d/K* | sort | grep zfs
	/etc/rc0.d/K01zfs-share
	/etc/rc0.d/K02zfs-mount
	/etc/rc0.d/K03zfs-import
	/etc/rc0.d/K04zfs-zed
	/etc/rc1.d/K01zfs-share
	/etc/rc1.d/K02zfs-mount
	/etc/rc1.d/K03zfs-import
	/etc/rc1.d/K04zfs-zed
	/etc/rc6.d/K01zfs-share
	/etc/rc6.d/K02zfs-mount
	/etc/rc6.d/K03zfs-import
	/etc/rc6.d/K04zfs-zed

Even the /etc/init.d/.depend.stop looks ok (as far as I can read it):

	TARGETS = urandom virtualbox-guest-utils zfs-share atd exim4 plymouth sendsigs zfs-mount zfs-import rsyslog umountnfs.sh zfs-zed rpcbind nfs-common hwclock.sh networking umountfs umountroot halt reboot
	sendsigs: atd virtualbox-guest-utils plymouth exim4 zfs-share
	rsyslog: atd sendsigs exim4
	umountnfs.sh: atd virtualbox-guest-utils plymouth rsyslog exim4 sendsigs zfs-share
	zfs-zed: zfs-import
	rpcbind: umountnfs.sh
	nfs-common: umountnfs.sh
	hwclock.sh: atd rsyslog nfs-common
	networking: rpcbind exim4 umountnfs.sh zfs-share
	umountfs: atd virtualbox-guest-utils hwclock.sh zfs-mount plymouth zfs-zed zfs-import rpcbind urandom networking exim4 umountnfs.sh zfs-share
	umountroot: umountfs
	halt: umountroot
	reboot: umountroot

Yet it still insists on shutting down the services in the wrong order...
--
Imagine you're an idiot and then imagine you're in
the government. Oh, sorry. Now I'm repeating myself
- Mark Twain




More information about the Pkg-sysvinit-devel mailing list