[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#753725: Please don't run "telinit u" under systemd



Package: libc6
Version: 2.19-4
Severity: important
Tags: patch

The current version of libc6.postint runs "telinit u" to tell init to
re-exec itself. This was added so the system can shutdown cleanly when
sysvinit is the active PID 1.

Under systemd this is not necessary since systemd uses a dedicated
systemd-shutdown [1] tool which replaces init on shutdown. This ensures all
file systems can be unmounted cleanly.

Running "telinit u" midway through a dist-upgrade can have unwanted side
effects as the systemd package might be in an inconsistent state.
As you can see at [2], apt decided to remove libaudit0 (which is a
dependency of systemd in wheezy) and replace it with libaudit1. The new
systemd package is not yet unpacked. Running "telinit u" in such a state
will then lead to kernel panic.

Therefore please consider applying the attached patch in your next
upload.

Cheers,
Michael


[1] http://www.freedesktop.org/software/systemd/man/systemd-halt.service.html
[2] http://people.debian.org/~biebl/Debian-2014-07-04T13-18-40-656412000Z.webm

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/debian/debhelper.in/libc.postinst b/debian/debhelper.in/libc.postinst
index 82ed0ba..1e8af5d 100644
--- a/debian/debhelper.in/libc.postinst
+++ b/debian/debhelper.in/libc.postinst
@@ -233,6 +233,11 @@ then
                 touch /var/run/init.upgraded
             fi
         fi
+        if [ -d /run/systemd/system ]; then
+            # Skip if systemd is the active PID 1, since systemd doesn't
+            # need a reexec for a clean shutdown
+            TELINIT=no
+        fi
     fi
     if [ "$TELINIT" = "yes" ]; then
         telinit u 2>/dev/null || true ; sleep 1

Reply to: