[Pkg-systemd-maintainers] Bug#724796: systemd loses track of rsyslog state when syslog.service is replaced during upgrade

Michael Biebl biebl at debian.org
Sat Sep 28 01:17:00 BST 2013


Package: systemd
Version: 204-5
Severity: important

I've been investigating a dist-upgrade failure, where rsyslog fails to
upgrade properly from its wheezy to jessie version.
The problem is, that the wheezy version shipped the
/etc/systemd/system/syslog.service symlink (pointing to rsyslog.service)
in the package and in jessie we use i-s-h to create the symlink upon
installation. During the upgrade, there is a time frame where the
syslog.service symlink has been removed by dpkg, but postinst has not
been run yet to (re)create the symlink. If at this point a daemon-reload
is issued (e.g. from another package via invoke-rc.d), systemd loses
track of the rsyslog process, which is still running.
So in rsyslog.posinst, when invoke-rc.d rsyslog restart is called,
systemd thinks rsyslog.service is dead and instead of restarting, starts
the service. As the old rsyslog process is still running, this fails.

To reproduce the issue, one can follow those steps:
- Make sure rsyslog is installed and running.
  status: step1.txt
- rm -f /etc/systemd/system/syslog.service
- systemctl daemon-reload
  status: step2.txt
- re-create symlink: systemctl enable rsyslog.service
- systemctl daemon-reload
  status: step3.txt
  (at this point systemd thinks, rsyslog.service is active (dead), while
  the rsyslog process is still happily running
- "systemctl restart rsyslog.service" produces
Job for rsyslog.service failed. See 'systemctl status rsyslog.service'
and 'journalctl -xn' for details.

Atm, the only workaround I see is to *manually* kill the old rsyslogd
process in postinst via kill $(cat /run/rsyslogd.pid) before the daemon
is restarted via invoke-rc.d rsyslog restart.
This is of course an ugly hack and I assume syslog-ng will be effected
by this in a similar way.
not a great solution.

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

Kernel: Linux 3.10-3-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

Versions of packages systemd depends on:
ii  initscripts          2.88dsf-43
ii  libacl1              2.2.52-1
ii  libaudit1            1:2.3.2-2
ii  libc6                2.17-93
ii  libcap2              1:2.22-1.2
ii  libcryptsetup4       2:1.6.1-1
ii  libdbus-1-3          1.6.14-1
ii  libgcrypt11          1.5.3-2
ii  libkmod2             15-0.1
ii  liblzma5             5.1.1alpha+20120614-2
ii  libpam0g             1.1.3-9
ii  libselinux1          2.1.13-2
ii  libsystemd-daemon0   204-5
ii  libsystemd-journal0  204-5
ii  libsystemd-login0    204-5
ii  libudev1             204-5
ii  libwrap0             7.6.q-24
ii  udev                 207-1
ii  util-linux           2.20.1-5.5

Versions of packages systemd recommends:
ii  libpam-systemd  204-5

Versions of packages systemd suggests:
ii  systemd-ui  2-2

-- no debconf information
-------------- next part --------------
rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled)
   Active: active (running) since Sa 2013-09-28 00:52:29 CEST; 1h 16min ago
 Main PID: 6285 (rsyslogd)
   CGroup: name=systemd:/system/rsyslog.service
           └─6285 /usr/sbin/rsyslogd -n

Sep 28 00:52:29 pluto systemd[1]: Started System Logging Service.

rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled)
   Active: active (running) since Sa 2013-09-28 00:52:29 CEST; 1h 16min ago
 Main PID: 6285 (rsyslogd)
   CGroup: name=systemd:/system/rsyslog.service
           └─6285 /usr/sbin/rsyslogd -n

Sep 28 00:52:29 pluto systemd[1]: Started System Logging Service.

syslog.socket - Syslog Socket
         Loaded: loaded (/lib/systemd/system/syslog.socket; static)
         Active: active (running) since Sa 2013-09-28 00:49:27 CEST; 1h 19min ago
           Docs: man:systemd.special(7)
                 http://www.freedesktop.org/wiki/Software/systemd/syslog
         Listen: /run/systemd/journal/syslog (Datagram)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
-------------- next part --------------
rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled)
   Active: active (running) since Sa 2013-09-28 00:52:29 CEST; 1h 18min ago
 Main PID: 6285 (rsyslogd)
   CGroup: name=systemd:/system/rsyslog.service
           └─6285 /usr/sbin/rsyslogd -n

Sep 28 00:52:29 pluto systemd[1]: Started System Logging Service.

syslog.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)


syslog.socket - Syslog Socket
         Loaded: loaded (/lib/systemd/system/syslog.socket; static)
         Active: active (running) since Sa 2013-09-28 00:49:27 CEST; 1h 21min ago
           Docs: man:systemd.special(7)
                 http://www.freedesktop.org/wiki/Software/systemd/syslog
         Listen: /run/systemd/journal/syslog (Datagram)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
-------------- next part --------------
rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled)
   Active: inactive (dead) since Sa 2013-09-28 00:52:29 CEST; 1h 19min ago
 Main PID: 6285 (rsyslogd)
   CGroup: name=systemd:/system/rsyslog.service
           └─6285 /usr/sbin/rsyslogd -n

Sep 28 00:52:29 pluto systemd[1]: Started System Logging Service.

rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled)
   Active: inactive (dead) since Sa 2013-09-28 00:52:29 CEST; 1h 19min ago
 Main PID: 6285 (rsyslogd)
   CGroup: name=systemd:/system/rsyslog.service
           └─6285 /usr/sbin/rsyslogd -n

Sep 28 00:52:29 pluto systemd[1]: Started System Logging Service.

syslog.socket - Syslog Socket
         Loaded: loaded (/lib/systemd/system/syslog.socket; static)
         Active: active (running) since Sa 2013-09-28 00:49:27 CEST; 1h 22min ago
           Docs: man:systemd.special(7)
                 http://www.freedesktop.org/wiki/Software/systemd/syslog
         Listen: /run/systemd/journal/syslog (Datagram)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.


More information about the Pkg-systemd-maintainers mailing list