diff options
author | Michael Biebl <biebl@debian.org> | 2014-08-18 02:42:28 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2014-08-18 02:42:32 +0200 |
commit | 2f1642fd1a4dadb6c9961afd792b7bf0811b8b75 (patch) | |
tree | 112572f163b2a6cafa26e61a7f2c0300cf00fe95 | |
parent | b816ea071c15bf13746dd8df4b41a1df53cf2b54 (diff) | |
download | rsyslog-2f1642fd1a4dadb6c9961afd792b7bf0811b8b75.tar.gz |
Make sure to actually only create the temporary syslog.service symlink on upgrades
... and avoid the usage of readlink.
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | debian/rsyslog.postinst | 2 | ||||
-rw-r--r-- | debian/rsyslog.preinst | 7 |
3 files changed, 11 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 3d9f124..189b6a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +rsyslog (8.2.2-5) UNRELEASED; urgency=medium + + * Make sure to actually only create the temporary syslog.service symlink on + upgrades and avoid the usage of readlink. + + -- Michael Biebl <biebl@debian.org> Mon, 18 Aug 2014 01:37:44 +0200 + rsyslog (8.2.2-4) unstable; urgency=medium * Fix wheezy → jessie upgrade failure when running under systemd due to the diff --git a/debian/rsyslog.postinst b/debian/rsyslog.postinst index 36ffc60..da1554a 100644 --- a/debian/rsyslog.postinst +++ b/debian/rsyslog.postinst @@ -25,7 +25,7 @@ case "$1" in 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 + if [ -d /run/systemd/system ] && dpkg --compare-versions "$2" lt-nl "7.4.1-2" ; then rm -f /run/systemd/system/syslog.service fi ;; diff --git a/debian/rsyslog.preinst b/debian/rsyslog.preinst index c15556c..8058953 100644 --- a/debian/rsyslog.preinst +++ b/debian/rsyslog.preinst @@ -16,10 +16,9 @@ fi # 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 +if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "7.4.1-2" ; then + if [ -d /run/systemd/system ] && [ -L /etc/systemd/system/syslog.service ] ; then + ln -sf /lib/systemd/system/rsyslog.service /run/systemd/system/syslog.service fi fi |