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

Alessandro Ghedini ghedo at debian.org
Wed Nov 27 10:27:42 GMT 2013


On sab, set 28, 2013 at 02:17:00 +0200, Michael Biebl wrote:
> 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.

Another solution that seems to work is running "systemctl reenable ..." instead
of just "enable". rsyslog does not get killed and correctly appears as
"active (running)" afterwards and can be restarted manually without problems.

To solve this, calling "deb-systemd-helper reenable" from postinst-systemd-enable
in dh-systemd would probably work, so maybe this should be reassign to
dh-systemd. I don't know if this would have any side effect though.

Cheers

-- 
perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20131127/bebaf007/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list