[Pkg-sysvinit-devel] Bug#874685: Acknowledgement (Do not run init scripts under systemd)

Michael Biebl biebl at debian.org
Fri Sep 8 19:24:58 UTC 2017


Control: tags -1 + pending

I took the liberty to upload this change to DELAYED/14 seeing that there
was no activity in Git or the mailing lists since may.

Please holler if you have any objections.

I would have committed my changes directly to git, but it seems Ian did
not update https://anonscm.debian.org/cgit/collab-maint/sysvinit.git
after his last commit.

So attached is the debdiff to 2.88dsf-59.9

Regards,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
-------------- next part --------------
diff -Nru sysvinit-2.88dsf/debian/bootlogd.postinst sysvinit-2.88dsf/debian/bootlogd.postinst
--- sysvinit-2.88dsf/debian/bootlogd.postinst	2017-02-12 22:55:39.000000000 +0100
+++ sysvinit-2.88dsf/debian/bootlogd.postinst	2017-09-08 21:18:31.000000000 +0200
@@ -1,15 +1,21 @@
 #!/bin/sh
 set -e
 
-if [ -x /etc/init.d/bootlogd ]; then
-    update-rc.d bootlogd             defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/stop-bootlogd-single ]; then
-    update-rc.d stop-bootlogd-single defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/stop-bootlogd ]; then
-    update-rc.d stop-bootlogd        defaults >/dev/null || exit $?
-fi
+INITSCRIPTS="bootlogd stop-bootlogd-single stop-bootlogd"
+
+for F in $INITSCRIPTS; do
+	if [ -x /etc/init.d/$F ]; then
+		update-rc.d $F defaults >/dev/null || exit $?
+	fi
+done
+
+mkdir -p /etc/systemd/system
+for F in $INITSCRIPTS; do
+	SERVICE="$(basename $F .sh).service"
+	if [ -x /etc/init.d/$F ] && [ ! -e /etc/systemd/system/$SERVICE ]; then
+		ln -s /dev/null /etc/systemd/system/$SERVICE
+	fi
+done
 
 #
 # Create initial log files
diff -Nru sysvinit-2.88dsf/debian/bootlogd.postrm sysvinit-2.88dsf/debian/bootlogd.postrm
--- sysvinit-2.88dsf/debian/bootlogd.postrm	2017-02-12 22:55:39.000000000 +0100
+++ sysvinit-2.88dsf/debian/bootlogd.postrm	2017-09-08 21:18:31.000000000 +0200
@@ -1,6 +1,8 @@
 #!/bin/sh
 set -e
 
+INITSCRIPTS="bootlogd stop-bootlogd-single stop-bootlogd"
+
 case "$1" in
     purge)
 	#
@@ -10,9 +12,19 @@
 
 	# Remove rc symlinks in the reverse dependency order they were
 	# inserted
-        update-rc.d stop-bootlogd        remove >/dev/null || exit $?
-        update-rc.d stop-bootlogd-single remove >/dev/null || exit $?
-        update-rc.d bootlogd             remove >/dev/null || exit $?
+	for F in $INITSCRIPTS; do
+		REVERSE="$F $REVERSE"
+	done
+	for F in $REVERSE; do
+		update-rc.d $F remove >/dev/null || exit $?
+	done
+
+	for F in $INITSCRIPTS; do
+		SERVICE="$(basename $F .sh).service"
+		if [ -L /etc/systemd/system/$SERVICE ]; then
+			rm /etc/systemd/system/$SERVICE
+		fi
+	done
         ;;
 esac
 
diff -Nru sysvinit-2.88dsf/debian/changelog sysvinit-2.88dsf/debian/changelog
--- sysvinit-2.88dsf/debian/changelog	2017-02-12 22:55:39.000000000 +0100
+++ sysvinit-2.88dsf/debian/changelog	2017-09-08 21:18:37.000000000 +0200
@@ -1,3 +1,14 @@
+sysvinit (2.88dsf-59.10) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * The init scripts provided by the bootlogd and initscripts package are
+    specific to sysvinit/sysv-rc and should not be run when systemd is the
+    active init system. To ensure that, mask those services by creating a
+    symlink pointing at /dev/null which tells systemd to ignore those
+    services. (Closes: #874685)
+
+ -- Michael Biebl <biebl at debian.org>  Fri, 08 Sep 2017 21:18:37 +0200
+
 sysvinit (2.88dsf-59.9) unstable; urgency=medium
 
   [ Martin Pitt ]
diff -Nru sysvinit-2.88dsf/debian/initscripts.postinst sysvinit-2.88dsf/debian/initscripts.postinst
--- sysvinit-2.88dsf/debian/initscripts.postinst	2017-02-12 22:55:39.000000000 +0100
+++ sysvinit-2.88dsf/debian/initscripts.postinst	2017-09-08 21:18:31.000000000 +0200
@@ -81,86 +81,25 @@
     fi
 fi
 
-#
-# Links in runlevel S
-#
-if [ -x /etc/init.d/mountkernfs.sh ]; then
-update-rc.d mountkernfs.sh         defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/hostname.sh ]; then
-update-rc.d hostname.sh            defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/mountdevsubfs.sh ]; then
-update-rc.d mountdevsubfs.sh       defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/checkroot.sh ]; then
-update-rc.d checkroot.sh           defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/checkroot-bootclean.sh ]; then
-update-rc.d checkroot-bootclean.sh defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/checkfs.sh ]; then
-update-rc.d checkfs.sh             defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/mountall.sh ]; then
-update-rc.d mountall.sh            defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/mountall-bootclean.sh ]; then
-update-rc.d mountall-bootclean.sh  defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/mountnfs.sh ]; then
-update-rc.d mountnfs.sh            defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/mountnfs-bootclean.sh ]; then
-update-rc.d mountnfs-bootclean.sh  defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/bootmisc.sh ]; then
-update-rc.d bootmisc.sh            defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/urandom ]; then
-update-rc.d urandom                defaults >/dev/null || exit $?
-fi
+INITSCRIPTS="mountkernfs.sh hostname.sh mountdevsubfs.sh checkroot.sh \
+	checkroot-bootclean.sh checkfs.sh mountall.sh mountall-bootclean.sh \
+	mountnfs.sh mountnfs-bootclean.sh bootmisc.sh urandom halt reboot \
+	umountroot umountfs umountnfs.sh sendsigs killprocs single motd \
+	bootlogs rc.local rmnologin"
 
-#
-# Links in runlevels other than S
-#
-if [ -x /etc/init.d/halt ]; then
-update-rc.d halt                   defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/reboot ]; then
-update-rc.d reboot                 defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/umountroot ]; then
-update-rc.d umountroot             defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/umountfs ]; then
-update-rc.d umountfs               defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/umountnfs.sh ]; then
-update-rc.d umountnfs.sh           defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/sendsigs ]; then
-update-rc.d sendsigs               defaults >/dev/null || exit $?
-fi
+for F in $INITSCRIPTS; do
+	if [ -x /etc/init.d/$F ]; then
+		update-rc.d $F defaults >/dev/null || exit $?
+	fi
+done
 
-if [ -x /etc/init.d/killprocs ]; then
-update-rc.d killprocs              defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/single ]; then
-update-rc.d single                 defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/motd ]; then
-update-rc.d motd                   defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/bootlogs ]; then
-update-rc.d bootlogs               defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/rc.local ]; then
-update-rc.d rc.local               defaults >/dev/null || exit $?
-fi
-if [ -x /etc/init.d/rmnologin ]; then
-update-rc.d rmnologin              defaults >/dev/null || exit $?
-fi
+mkdir -p /etc/systemd/system
+for F in $INITSCRIPTS; do
+	SERVICE="$(basename $F .sh).service"
+	if [ -x /etc/init.d/$F ] && [ ! -e /etc/systemd/system/$SERVICE ]; then
+		ln -s /dev/null /etc/systemd/system/$SERVICE
+	fi
+done
 
 #
 # Remove scripts that were left behind by older glibc (<< 2.3.2.ds1-12)
diff -Nru sysvinit-2.88dsf/debian/initscripts.postrm sysvinit-2.88dsf/debian/initscripts.postrm
--- sysvinit-2.88dsf/debian/initscripts.postrm	2017-02-12 22:55:39.000000000 +0100
+++ sysvinit-2.88dsf/debian/initscripts.postrm	2017-09-08 21:18:31.000000000 +0200
@@ -4,7 +4,13 @@
 #
 
 set -e
- 
+
+INITSCRIPTS="mountkernfs.sh hostname.sh mountdevsubfs.sh checkroot.sh \
+	checkroot-bootclean.sh checkfs.sh mountall.sh mountall-bootclean.sh \
+	mountnfs.sh mountnfs-bootclean.sh bootmisc.sh urandom halt reboot \
+	umountroot umountfs umountnfs.sh sendsigs killprocs single motd \
+	bootlogs rc.local rmnologin"
+
 case "$1" in
   purge)
 	#
@@ -46,30 +52,19 @@
 
 	# Remove rc symlinks in the reverse dependency order they were
 	# inserted
-	update-rc.d rmnologin              remove >/dev/null || exit $?
-	update-rc.d rc.local               remove >/dev/null || exit $?
-	update-rc.d motd                   remove >/dev/null || exit $?
-	update-rc.d bootlogs               remove >/dev/null || exit $?
-	update-rc.d single                 remove >/dev/null || exit $?
-	update-rc.d killprocs              remove >/dev/null || exit $?
-	update-rc.d sendsigs               remove >/dev/null || exit $?
-	update-rc.d umountnfs.sh           remove >/dev/null || exit $?
-	update-rc.d umountfs               remove >/dev/null || exit $?
-	update-rc.d umountroot             remove >/dev/null || exit $?
-	update-rc.d reboot                 remove >/dev/null || exit $?
-	update-rc.d halt                   remove >/dev/null || exit $?
-	update-rc.d urandom                remove >/dev/null || exit $?
-	update-rc.d bootmisc.sh            remove >/dev/null || exit $?
-	update-rc.d mountnfs-bootclean.sh  remove >/dev/null || exit $?
-	update-rc.d mountnfs.sh            remove >/dev/null || exit $?
-	update-rc.d mountall-bootclean.sh  remove >/dev/null || exit $?
-	update-rc.d mountall.sh            remove >/dev/null || exit $?
-	update-rc.d checkfs.sh             remove >/dev/null || exit $?
-	update-rc.d checkroot-bootclean.sh remove >/dev/null || exit $?
-	update-rc.d checkroot.sh           remove >/dev/null || exit $?
-	update-rc.d mountdevsubfs.sh       remove >/dev/null || exit $?
-	update-rc.d hostname.sh            remove >/dev/null || exit $?
-	update-rc.d mountkernfs.sh         remove >/dev/null || exit $?
+	for F in $INITSCRIPTS; do
+		REVERSE="$F $REVERSE"
+	done
+	for F in $REVERSE; do
+		update-rc.d $F remove >/dev/null || exit $?
+	done
+
+	for F in $INITSCRIPTS; do
+		SERVICE="$(basename $F .sh).service"
+		if [ -L /etc/systemd/system/$SERVICE ]; then
+			rm /etc/systemd/system/$SERVICE
+		fi
+	done
 
 	# Remove /dev/pts and /dev/shm ?
 	;;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20170908/be76dee2/attachment-0001.sig>


More information about the Pkg-sysvinit-devel mailing list