summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-08-18 00:34:33 +0200
committerMichael Biebl <biebl@debian.org>2014-08-18 00:37:30 +0200
commit8cce420af5e064c01a56a83af0d822ae74f82a5b (patch)
tree42282492c367ec9d80b885787ea94248b4d1aaf9
parentd56165f8ec9a8b2b2771128d3a001fa9895b8d47 (diff)
downloadrsyslog-8cce420af5e064c01a56a83af0d822ae74f82a5b.tar.gz
Fix wheezy → jessie upgrade failure when running under systemd
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
-rw-r--r--debian/changelog7
-rw-r--r--debian/rsyslog.postinst5
-rw-r--r--debian/rsyslog.preinst13
3 files changed, 25 insertions, 0 deletions
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 <biebl@debian.org> 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#