systemd: Replace Requires with BindTo+After for main socket

This is the strongest relationship that can be declared between
two units, and causes the service to be terminated immediately
if its main socket disappears. This is the behavior we want.

Note that we don't do the same for the read-only/admin sockets,
because those are not as critical for the core functionality of
services as the main socket it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-09-25 17:09:37 +02:00
parent f90b9b199e
commit e708f4af97
3 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,8 @@
[Unit]
Description=Virtual machine lock manager
Requires=virtlockd.socket
BindsTo=virtlockd.socket
Requires=virtlockd-admin.socket
After=virtlockd.socket
Before=libvirtd.service
Documentation=man:virtlockd(8)
Documentation=https://libvirt.org

View File

@ -1,7 +1,8 @@
[Unit]
Description=Virtual machine log manager
Requires=virtlogd.socket
BindsTo=virtlogd.socket
Requires=virtlogd-admin.socket
After=virtlogd.socket
Before=libvirtd.service
Documentation=man:virtlogd(8)
Documentation=https://libvirt.org

View File

@ -1,8 +1,9 @@
[Unit]
Description=@name@ daemon
Requires=@service@.socket
BindsTo=@service@.socket
Requires=@service@-ro.socket
Requires=@service@-admin.socket
After=@service@.socket
Conflicts=libvirtd.service
After=libvirtd.service
After=network.target