[pulseaudio-discuss] Service File for running in system mode

Florian Lindner mailinglists at xgm.de
Tue Oct 4 18:29:55 UTC 2016


One thing which still makes trouble is restoring of card state.

In my system.pa there is:

load-module module-stream-restore
load-module module-device-restore
load-module module-card-restore

card-restore wasn't included in the default config, I copied it over
from default.pa.

Still, the default card is always muted and I got to login and use
pavucontrol to unmute.

Any ideas?

Thanks!

Am 04.10.2016 um 19:42 schrieb Florian Lindner:
> Hey,
> 
> ok, my working configuration on Arch with pulseaudio 9.0.
> 
> The unit file:
> 
> # /etc/systemd/system/pulseaudio.service
> [Unit]
> Description=PulseAudio system server
> After=dbus.socket
> Wants=dbus.socket
> 
> [Service]
> Type=notify
> ExecStart=/usr/bin/pulseaudio --daemonize=no --system --realtime
> --disallow-module-loading --disallow-exit --log-target=journal
> 
> [Install]
> WantedBy=sound.target
> 
> 
> Configure users according to:
> 
> https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
> 
> In /etc/pulse/client.conf set
> 
> default-server = /var/run/pulse/native
> 
> Add user pulse to group audio.
> The client user does not need audio group.
> 
> Seems to work so far...
> 
> Thanks for any improvements
> Florian
> 
> Am 04.10.2016 um 13:22 schrieb Tanu Kaskinen:
>> On Thu, 2016-09-29 at 17:52 +0200, Florian Lindner wrote:
>>> Hello,
>>>
>>> I know that running pulseaudio in system mode is discouraged, but there
>>> are valid use cases.
>>>
>>> Is there an official upstream systemd service file for that? I found a
>>> couple of variants on the internet, but I would prefer to use an
>>> recommeded one?
>>
>> No, there's no official upstream file. I think it would be good to have
>> one, though. Would you like to contribute a patch?
>>
>>> - Is is Type simple or notify?
>>
>> notify
>>
>>> - Should --disallow-exit be set?
>>
>> Yes, I think that's a good idea.
>>
>>> - I have found service files that use "After=sound.target dbus.service"
>>> as well as "Before=sound.target". What is correct?
>>
>> To me it seems most sensible to have pulseaudio as a part of
>> sound.target, so using WantedBy=sound.target would make the most sense
>> to me.
>>
>> For dealing with the dbus dependency, I think Wants=dbus.socket and
>> After=dbus.socket would be appropriate.
>>
>> My advice is not based on trying to actually run pulseaudio in the
>> system mode as a systemd service.
>>
>>> - What is it WantedBy?
>>
>> If you use it in the pulseaudio service file, it makes pulseaudio a
>> dependency for something else. See here for details:
>> https://www.freedesktop.org/software/systemd/man/systemd.unit.html
>>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
> 


More information about the pulseaudio-discuss mailing list