Skip to content

Commit

Permalink
Merge branch 'jb49307' into 'master'
Browse files Browse the repository at this point in the history
Avoid having system and user session daemon running simultaneously.

See merge request mer-core/pulseaudio!34
  • Loading branch information
jusa committed Mar 12, 2020
2 parents 5c260d3 + 1464ed9 commit aea1f9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions rpm/pulseaudio-system.service
Expand Up @@ -9,9 +9,12 @@ Before=multi-user.target systemd-user-sessions.service
PartOf=emergency-call.target

[Service]
Type=forking
PIDFile=%t/pulse/pid
EnvironmentFile=-/etc/sysconfig/pulseaudio
ExecStart=/usr/bin/pulseaudio --daemonize --system --disallow-module-loading $CONFIG
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
8 changes: 5 additions & 3 deletions rpm/pulseaudio.service
Expand Up @@ -4,12 +4,14 @@ After=pre-user-session.target
Requires=dbus.socket

[Service]
Type=forking
PIDFile=%t/pulse/pid
EnvironmentFile=-/etc/sysconfig/pulseaudio
ExecStart=/usr/bin/pulseaudio --start $CONFIG
# 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
Type=notify

[Install]
WantedBy=user-session.target

0 comments on commit aea1f9d

Please sign in to comment.