Skip to content

Commit

Permalink
sfos: Prevent user session daemon from starting if system daemon is r…
Browse files Browse the repository at this point in the history
…unning.

Wait until system daemon pid file disappears before starting user
session PulseAudio.

See JB#49307
  • Loading branch information
jusa committed Mar 12, 2020
1 parent 685a6aa commit 1464ed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rpm/pulseaudio-system.service
Expand Up @@ -11,6 +11,10 @@ PartOf=emergency-call.target
[Service]
EnvironmentFile=-/etc/sysconfig/pulseaudio
ExecStart=/usr/bin/pulseaudio --daemonize=no --system --disallow-module-loading $CONFIG
# Make sure pid file is cleaned when stopping system PulseAudio,
# as user session service will defer startup until the pid file
# doesn't exist anymore.
ExecStopPost=/bin/sh -c "rm -f /run/pulse/pid"
Restart=always
RestartSec=1
Type=notify
3 changes: 3 additions & 0 deletions rpm/pulseaudio.service
Expand Up @@ -5,6 +5,9 @@ Requires=dbus.socket

[Service]
EnvironmentFile=-/etc/sysconfig/pulseaudio
# Wait until system PulseAudio daemon has completely shut down before
# starting user session daemon.
ExecStartPre=/bin/sh -c "while [ -f /run/pulse/pid ]; do sleep 1; done"
ExecStart=/usr/bin/pulseaudio --daemonize=no $CONFIG
Restart=always
RestartSec=1
Expand Down

0 comments on commit 1464ed9

Please sign in to comment.