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

Peter Valdemar Mørch peter at morch.com
Wed Feb 4 06:53:50 PST 2015


Thank you Lennart for your explanation about the enqueuing. Sounds
reasonable. And helps me understand! :-)

Here I reply to you a little out of order:

On Wed, Feb 4, 2015 at 2:34 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> 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.

So have I understood this correctly: That the order matters *is* a
bug. Either in systemd (that provides
/lib/systemd/system/syslog.socket) or in syslog-ng and rsyslog that
provide e.g. /lib/systemd/system/syslog-ng.service ?

I'm worried that we manually have to figure out the correct ordering
of names to "systemctl restart PATTERN...." and would like to be able
to rely on systemctl to figure that out for us. Is that a reasonable
long-term expectation? (And the reason order/sequence isn't mentioned
in the man page?)

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

That in fact is what we might end up doing as it fixes this instance
of the problem short-term. I just want to understand what is going on
to determine if we're going to run into headaches long-term.

> Whats are the precise ordering and requirement deps between those two
> services?

I have no idea what they *should* be, but to show what they *are*,
here i show for syslog-ng. Seems to me that syslog-ng is clear about
syslog.socket being a dependency:

> cat /lib/systemd/system/syslog-ng.service
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)

[Service]
Type=notify
Sockets=syslog.socket
ExecStart=/usr/sbin/syslog-ng -F
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null
Restart=on-failure

[Install]
WantedBy=multi-user.target
Alias=syslog.service

> systemctl list-dependencies -l syslog-ng | cat
syslog-ng.service
● ├─syslog.socket
● ├─system.slice
● └─basic.target
●   ├─paths.target
●   │ └─acpid.path
●   ├─slices.target
●   │ ├─-.slice
●   │ └─system.slice
●   ├─sockets.target
●   │ ├─acpid.socket
●   │ ├─dbus.socket
●   │ ├─systemd-initctl.socket
●   │ ├─systemd-journald-dev-log.socket
●   │ ├─systemd-journald.socket
●   │ ├─systemd-shutdownd.socket
●   │ ├─systemd-udevd-control.socket
●   │ └─systemd-udevd-kernel.socket
●   ├─sysinit.target
●   │ ├─console-setup.service
●   │ ├─debian-fixup.service
●   │ ├─dev-hugepages.mount
●   │ ├─dev-mqueue.mount
●   │ ├─hdparm.service
●   │ ├─kbd.service
●   │ ├─keyboard-setup.service
●   │ ├─kmod-static-nodes.service
●   │ ├─networking.service
●   │ ├─nfs-common.service
●   │ ├─proc-sys-fs-binfmt_misc.automount
●   │ ├─rpcbind.service
●   │ ├─sys-fs-fuse-connections.mount
●   │ ├─sys-kernel-config.mount
●   │ ├─sys-kernel-debug.mount
●   │ ├─systemd-ask-password-console.path
●   │ ├─systemd-binfmt.service
●   │ ├─systemd-journal-flush.service
●   │ ├─systemd-journald.service
●   │ ├─systemd-modules-load.service
●   │ ├─systemd-random-seed.service
●   │ ├─systemd-sysctl.service
●   │ ├─systemd-tmpfiles-setup-dev.service
●   │ ├─systemd-tmpfiles-setup.service
●   │ ├─systemd-udev-trigger.service
●   │ ├─systemd-udevd.service
●   │ ├─systemd-update-utmp.service
●   │ ├─udev-finish.service
●   │ ├─vmware-tools.service
●   │ ├─cryptsetup.target
●   │ ├─local-fs.target
●   │ │ ├─-.mount
●   │ │ ├─jail-dev.mount
●   │ │ ├─jail-proc.mount
●   │ │ ├─jail-tftp-cliusers.mount
●   │ │ ├─systemd-fsck-root.service
●   │ │ └─systemd-remount-fs.service
●   │ └─swap.target
●   │   ├─dev-disk-by\x2duuid-37ac7cd8\x2d4a9c\x2d4118\x2d8192\x2d7ecaf6229d75.swap
●   │   └─dev-disk-by\x2duuid-37ac7cd8\x2d4a9c\x2d4118\x2d8192\x2d7ecaf6229d75.swap
●   └─timers.target
●     └─systemd-tmpfiles-clean.timer

Thanks,

Peter

-- 
Peter Valdemar Mørch
http://www.morch.com


More information about the systemd-devel mailing list