From f3692de0c55c6dd57933a25ec7312f44b876458d Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Thu, 3 Oct 2019 17:04:24 +0200 Subject: [PATCH] pulseaudio: let systemd know the PID of the pulseaudio daemon Otherwise, systemd will have to guess the PID of the service's main process. It guesses right most of the time, but sometimes it chooses the PID of the original pulseaudio process instead of the daemon that gets forked off. This caused the daemon to stop immediately after starting, breaking other apps that require the pulseaudio server to be running. Since the PID file is created in a user-specific runtime directory (and the service is meant for the whole system), modify the wrapper script to create a symlink to the PID file in a place where it can be obtained by systemd. https://jira.digi.com/browse/DEL-6795 Signed-off-by: Gabriel Valcazar --- .../recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-init | 3 +++ .../pulseaudio/pulseaudio/pulseaudio-system.service | 1 + 2 files changed, 4 insertions(+) diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-init b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-init index 14096506d..46a31676b 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-init +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-init @@ -9,3 +9,6 @@ export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus pulseaudio --start + +# Create a symlink to the daemon's PID file in a more accesible directory +ln -sf $XDG_RUNTIME_DIR/pulse/pid /run/pulse.pid diff --git a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-system.service b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-system.service index f1fa28d69..8a7f8cc0b 100644 --- a/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-system.service +++ b/meta-digi-dey/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-system.service @@ -4,6 +4,7 @@ After=dbus.service [Service] Type=forking +PIDFile=/run/pulse.pid ExecStart=/etc/pulseaudio-init ExecStop=kill -HUP $MAINPID