xrt: prevent systemd from starting Monado quickly

If an OpenXR client starts Monado using socket activation, but Monado
crashes during its startup, systemd will try to start the service for
each subsequent IPC message, which causes both units to enter a failed
state.

By enabling
[`FlushPending`](https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html#FlushPending=),
systemd will flush pending messages and close the connection to the IPC
client, preventing restarts in quick succession.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-01-12 11:39:30 +01:00
parent 084dae3c7e
commit 0df6f9606b
No known key found for this signature in database
GPG key ID: E13DFD4B47127951

View file

@ -9,6 +9,7 @@ Conflicts=@conflicts@.socket
[Socket]
ListenStream=%t/@XRT_IPC_MSG_SOCK_FILENAME@
RemoveOnStop=true
FlushPending=true
[Install]
WantedBy=sockets.target