Your message dated Fri, 22 Sep 2017 21:06:48 +0000
with message-id <[email protected]>
and subject line Bug#874685: fixed in sysvinit 2.88dsf-59.10
has caused the Debian Bug report #874685,
regarding Do not run init scripts under systemd
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
874685: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874685
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: sysvinit
Version: 2.88dsf-59.9
Severity: normal
Tags: patch
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 as they can be actively harmful.
To ensure that, mask those services by creating a symlink pointing at
/dev/null which tells systemd to ignore those services.
While at it, simplify the maintainer scripts when dealing with those
init scripts.
By using a variable holding all init scripts we can easily iterate over
them and reverse the order. This is less error prone and avoids lots of
duplicated code.
Thanks for considering.
Michael
-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.12.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8),
LANGUAGE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
>From caf88d63c053a815f9cad3753233c6a73af649a7 Mon Sep 17 00:00:00 2001
From: Michael Biebl <[email protected]>
Date: Fri, 8 Sep 2017 18:48:53 +0200
Subject: [PATCH] Do not run init scripts under systemd
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.
While at it, simplify the maintainer scripts when dealing with those
init scripts.
---
debian/bootlogd.postinst | 24 ++++++-----
debian/bootlogd.postrm | 18 +++++++--
debian/initscripts.postinst | 97 +++++++++------------------------------------
debian/initscripts.postrm | 45 ++++++++++-----------
4 files changed, 68 insertions(+), 116 deletions(-)
diff --git a/debian/bootlogd.postinst b/debian/bootlogd.postinst
index eddd4210..50ab21ad 100644
--- a/debian/bootlogd.postinst
+++ b/debian/bootlogd.postinst
@@ -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 --git a/debian/bootlogd.postrm b/debian/bootlogd.postrm
index 23d776bc..2705c154 100644
--- a/debian/bootlogd.postrm
+++ b/debian/bootlogd.postrm
@@ -1,6 +1,8 @@
#!/bin/sh
set -e
+INITSCRIPTS="bootlogd stop-bootlogd-single stop-bootlogd"
+
case "$1" in
purge)
#
@@ -10,9 +12,19 @@ case "$1" in
# 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 --git a/debian/initscripts.postinst b/debian/initscripts.postinst
index 259ce38c..94c3dbc5 100755
--- a/debian/initscripts.postinst
+++ b/debian/initscripts.postinst
@@ -81,86 +81,25 @@ if dpkg --compare-versions "$PREV_VER" lt-nl "2.88dsf-23" ;
then
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
-
-#
-# 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
+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"
+
+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 --git a/debian/initscripts.postrm b/debian/initscripts.postrm
index 5debca4c..99e62c04 100755
--- a/debian/initscripts.postrm
+++ b/debian/initscripts.postrm
@@ -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 @@ case "$1" in
# 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 ?
;;
--
2.14.1
--- End Message ---
--- Begin Message ---
Source: sysvinit
Source-Version: 2.88dsf-59.10
We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Biebl <[email protected]> (supplier of updated sysvinit package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Fri, 08 Sep 2017 21:18:37 +0200
Source: sysvinit
Binary: sysvinit-core sysvinit-utils sysv-rc initscripts bootlogd
Architecture: source
Version: 2.88dsf-59.10
Distribution: unstable
Urgency: medium
Maintainer: Debian sysvinit maintainers
<[email protected]>
Changed-By: Michael Biebl <[email protected]>
Description:
bootlogd - daemon to log boot messages
initscripts - scripts for initializing and shutting down the system
sysv-rc - System-V-like runlevel change mechanism
sysvinit-core - System-V-like init utilities
sysvinit-utils - System-V-like utilities
Closes: 874685
Changes:
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)
Checksums-Sha1:
8e4b2e96ceba4771c28033a861d2a54c487a19c8 2353 sysvinit_2.88dsf-59.10.dsc
42fde763257d5bf46c1aaa98f37821965c88f7b0 132504
sysvinit_2.88dsf-59.10.debian.tar.xz
ffee3d328f55b1e96329da28239e475388b8960d 5720
sysvinit_2.88dsf-59.10_source.buildinfo
Checksums-Sha256:
b25f6800b2c0f1cfd978979f25371a79493c81c6ad0815b541d12deaae75e319 2353
sysvinit_2.88dsf-59.10.dsc
3dd24f403de4565abe55181fbde15ac013e520bf65f159b875637f6c41972519 132504
sysvinit_2.88dsf-59.10.debian.tar.xz
a8628eb930ea137b3cee4d95d5a118cec2de06b9a0300fa100f5184b6090786b 5720
sysvinit_2.88dsf-59.10_source.buildinfo
Files:
eae164cee61b74da2de4f96aecbe8d0b 2353 admin optional sysvinit_2.88dsf-59.10.dsc
8fc3795be920a53f86415e39d148ef43 132504 admin optional
sysvinit_2.88dsf-59.10.debian.tar.xz
19e2636a5302e4f84180e16cac2da538 5720 admin optional
sysvinit_2.88dsf-59.10_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEECbOsLssWnJBDRcxUauHfDWCPItwFAlmy7ZwACgkQauHfDWCP
ItxeKQ//R8M4uwWAc7pIykZf8HhDP5t1SgO3DHabNCljb0w8CyARiszOGm1KCjTF
vNW+V+Z02GJMqItPvJ3Cd5nHABKicA4OIbSknd9ERYrCY6OI0gTU33ubHxC2HskV
tPb9k5fDI+mgtQW3ei+qGfofOhAEmiYwKqkLtg0gwABB5ve83bRbLUB1UcLAHs0l
cg8MbRJkcZjujNcBATSDNhREN4JbjyTBHSPw4boIiSPFT2H53MqtFoBDYQi1BZlv
SKvrZjt3TvM4XfBRDG4uZN/YYBMLc2bEjS3ILTGdrhLtTqkYIwsSm467Y+82KfuE
TIh9zni2PvsslRpWsl6auY31lWUe43mP/QnroVjt3d5OvRlkV6DXf14EELWnYI6J
7FJ2qRVSe2pJqnCj9wPsFkIVkWeq85C44OtvZ0nFvgs0n6NTzxuC8fV8C0EdPIE0
XQZ0zHdKOYopsEJRfW78eIo3IG+nglud80vnPUDtmqjfp/lUf7qzwreLgdRUkvy6
e4+ItrRpqkmpTXgHod8TdE05M5tuNCHGxsuYjnEvn7UK0GEhcbBO49LOuNinmOqC
FfVhliqqxr2l3P84cvnc6zgNt6WnpvqLq8FnrGR6YZBTOfmPJxZ0f7M5HVeVl9yV
HF+QdJtE/Rs8zEYLzdjBjCy7csIQcI1VoloZYrq/oITiuCWTp4c=
=4+DV
-----END PGP SIGNATURE-----
--- End Message ---