From 32512a8962dd0c60fb2f10ae61866f2da796d038 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 24 Feb 2021 22:05:14 +0200 Subject: [PATCH] systemd: system-mode: preserve /run/pipewire after the daemon stops /run/pipewire is initially created by pipewire.socket when it creates the socket file, but it is owned by root with mode 0755. In the .service unit, RuntimeDirectory=pipewire re-creates /run/pipewire for user pipewire (owned by pipewire:pipewire, 0755) when this unit starts. This is necessary for the pipewire daemon to be able to write the .lock file. By default, when the service unit stops, systemd deletes this runtime directory and therefore it also deletes the socket that is owned by pipewire.socket. When this happens, the service is no longer socket-activateable even though pipewire.socket is active. RuntimeDirectoryPreserve=yes prevents the service unit from removing this runtime directory and socket activation still works as expected --- src/daemon/systemd/system/pipewire.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/daemon/systemd/system/pipewire.service.in b/src/daemon/systemd/system/pipewire.service.in index 5bdb2c77d..23971e4a9 100644 --- a/src/daemon/systemd/system/pipewire.service.in +++ b/src/daemon/systemd/system/pipewire.service.in @@ -25,6 +25,7 @@ Type=simple ExecStart=@PW_BINARY@ Restart=on-failure RuntimeDirectory=pipewire +RuntimeDirectoryPreserve=yes User=pipewire Environment=PIPEWIRE_RUNTIME_DIR=%t/pipewire