[pulseaudio-discuss] [PATCH 6/8] launch: Add systemd units for launching pulseaudio user instances

Colin Guthrie gmane at colin.guthr.ie
Mon Nov 3 03:32:43 PST 2014


Tanu Kaskinen wrote on 03/11/14 11:07:
> On Mon, 2014-11-03 at 09:42 +0000, Colin Guthrie wrote:
>> diff --git a/src/daemon/systemd/user/pulseaudio.service.in b/src/daemon/systemd/user/pulseaudio.service.in
>> new file mode 100644
>> index 0000000..e08ff1e
>> --- /dev/null
>> +++ b/src/daemon/systemd/user/pulseaudio.service.in
>> @@ -0,0 +1,10 @@
>> +[Unit]
>> +Description=Sound Service
>> +
>> +[Service]
>> +ExecStart=@PA_BINARY@ --daemonize=no
>> +Restart=on-failure
> 
> In the previous version the restart policy was "always". How does
> "on-failure" interact with socket activation? If I shut down PulseAudio
> cleanly with "pactl exit", will PulseAudio be started again when the
> next client tries to connect to the socket?

Yeah I took some of the arguments from the other patch series that
looked sensible and forgot to mention that in my little summary - sorry :(


Yes, the Restart= directive only applies to the service unit itself - it
doesn't propagate to the .socket.

If you exit with pactl exit (or have an idle-timeout configured), then
the service will die (cleanly) but the socket will still be listening
and will trigger a start again if someone new connects.

This is similar to the behaviour when you call "systemctl --user stop
pulseaudio.service" - in this scenario, systemctl gives you a nice
warning telling you that although you've stopped the service, it might
be started again via the socket.

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the pulseaudio-discuss mailing list