[systemd-devel] Restart sequence: "systemctl restart rsyslog.service syslog.socket" often/sometimes fails

Lennart Poettering lennart at poettering.net
Wed Feb 4 05:34:01 PST 2015

On Wed, 04.02.15 11:13, Peter Valdemar Mørch (peter at morch.com) wrote:

> First: Please let me know if this is an inappropriate place to ask this
> # systemctl restart syslog.socket rsyslog.service
> seems to always work. But
> # systemctl restart  rsyslog.service syslog.socket
> , the opposite sequence, seems to sometimes fail (details below). I'm
> wondering: Why is that?

Whats are the precise ordering and requirement deps between those two

Note that the command will first enqueue the restart job for the first
mentioned service, then the restart job for the second service. It
will then wait for both jobs to complete. Depending on the deps it
might happen in the second case, that the service is first stopped,
and then the socket stopped, and then the service started again. Now,
when the socket is about to be started again too, the service will
already be up, but in non-socket-activation mode, at which point the
socket unit refuses to start up, in order to not corrupt the socket
the service created on its own without usage of socket activation.

This is something that can be fixed by adding stricter deps between
the service and the socket, so that the socket is always required to
be started before the service. Something for the respective package
maintainers upstream to fix.

Alternatively, only restart the service, don't bother with the socket...


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list