From 8cce420af5e064c01a56a83af0d822ae74f82a5b Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 18 Aug 2014 00:34:33 +0200 Subject: Fix wheezy → jessie upgrade failure when running under systemd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the upgrade the statically shipped symlink is replaced by one which is created in postinst by init-system-helpers. When systemd is reloaded while the symlink is missing, it loses track of the running rsyslogd process. As a workaround, create a runtime copy of the syslog.service symlink before the upgrade and remove it afterwards. See #724796 --- debian/changelog | 7 +++++++ debian/rsyslog.postinst | 5 +++++ debian/rsyslog.preinst | 13 +++++++++++++ 3 files changed, 25 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 80eeaba..77fc851 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +rsyslog (8.2.2-4) UNRELEASED; urgency=medium + + * Fix wheezy → jessie upgrade failure when running under systemd due to the + syslog.service symlink temporarily being missing. + + -- Michael Biebl Sun, 17 Aug 2014 18:57:06 +0200 + rsyslog (8.2.2-3) unstable; urgency=low * Upload to unstable. diff --git a/debian/rsyslog.postinst b/debian/rsyslog.postinst index 7bcc66f..36ffc60 100644 --- a/debian/rsyslog.postinst +++ b/debian/rsyslog.postinst @@ -23,6 +23,11 @@ case "$1" in # Fix permissions of the spool/work directory (Bug: #693099) chmod 700 /var/spool/rsyslog + + # Clean up temporary syslog.service symlink + if [ -d /run/systemd/system ] && dpkg --compare-versions "$2" lt "7.4.1-2" ; then + rm -f /run/systemd/system/syslog.service + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/rsyslog.preinst b/debian/rsyslog.preinst index ae2c5f0..c15556c 100644 --- a/debian/rsyslog.preinst +++ b/debian/rsyslog.preinst @@ -10,4 +10,17 @@ if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.7.8-1" ; then rm -f /etc/systemd/system/sockets.target.wants/rsyslog.socket fi +# In wheezy we ship the syslog.service symlink directly in the package, in +# jessie we use init-system-helpers to create it dynamically in postinst. +# During the upgrade there is a time frame when the symlink does not exist. +# If systemd is reloaded at this point, it loses track of the rsyslogd process. +# To work around this problem, create a (runtime) copy of the syslog.service +# symlink before the upgrade and remove it again afterwards. See #724796 +if [ -d /run/systemd/system ] && dpkg --compare-versions "$2" lt "7.4.1-2" ; then + target=$(readlink /etc/systemd/system/syslog.service) + if [ "$target" = /lib/systemd/system/rsyslog.service ] ; then + ln -sf "$target" /run/systemd/system/syslog.service + fi +fi + #DEBHELPER# -- cgit v1.2.3