[systemd-devel] Still confused with socket activation

Lennart Poettering lennart at poettering.net
Tue Feb 2 14:59:54 UTC 2021


On Di, 02.02.21 10:43, Ulrich Windl (Ulrich.Windl at rz.uni-regensburg.de) wrote:

> Hi!
>
> Having:
> ---
> # /usr/lib/systemd/system/virtlockd.service
> [Unit]
> Description=Virtual machine lock manager
> Requires=virtlockd.socket
> Requires=virtlockd-admin.socket
> Before=libvirtd.service
> ...
> ---
>
> How would I start both sockets successfully unter program control?
> If I start one socket, I cannot start the other without an error (as libvirtd.service is running already, see my earlier message from last week).
> If I mask the socket units, I cannot start the libvirtd.service.
> So would I disable the socket units and start libvirtd.service?
> Unfortunately if someone (update when vendor-preset is enabled) re-enables the socket units, it would break things, so I tried to mask them, but that failed, too.
> error: Could not issue start for prm_virtlockd: Unit virtlockd.socket is masked.

I don't grok what you are trying to say, the excerpt of the unit file
is too short. Please provide the relevant parts of the other unit
files too.

Masking is a big hammer, the last resort. It should not be part of the
usual workflow.

Note that Requires= in almost all cases should be combined with an
order dep of After= onto the same unit. If the unit above doesn't do
that it's almost certainly broken.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list