Commit 102b2e75 authored by Jonathon Jongsma's avatar Jonathon Jongsma
Browse files

systemd: use "After" with "Requisite"

The "Requisite" directive is intended to require that the virtio port
device exists before starting the vdagent socket unit. If the device
does not exist, the socket should fail to start. However, without using
"After", the socket will still start even when the device is not
present.

The man page for systemd.unit (v239+) says the following about
'Requisite=':

"Similar to Requires=. However, if the units listed here are not
started already, they will not be started and the starting of this unit
will fail immediately. Requisite= does not imply an ordering
dependency, even if both units are started in the same transaction.
Hence this setting should usually be combined with After=, to ensure
this unit is not started before the other unit."

See also https://github.com/systemd/systemd/issues/4756 for further
details (particularly the following comment:
https://github.com/systemd/systemd/issues/4756#issuecomment-267005324

)
Signed-off-by: default avatarJonathon Jongsma <jjongsma@redhat.com>
Acked-by: Lukáš Hrázký's avatarLukáš Hrázký <lhrazky@redhat.com>
parent b245cbdd
Pipeline #7424 passed with stage
in 10 minutes and 7 seconds
......@@ -2,6 +2,7 @@
Description=Activation socket for spice guest agent daemon
# only start the socket if the virtio port device exists
Requisite=dev-virtio\x2dports-com.redhat.spice.0.device
After=dev-virtio\x2dports-com.redhat.spice.0.device
[Socket]
ListenStream=/var/run/spice-vdagentd/spice-vdagent-sock
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment