User systemd PulseAudio service

Not much else to this question: I would like to know what I need to create a PulseAudio systemd service to be run with systemd --user.

I’ve tried a few different things, including various user services from Google, but I can’t get it set up just right between dbus and everything else required for it.

Update: It seems to work ok with graphical sessions, but I’m still having some inconsistancy with dbus when logging in through console. But PulseAudio is starting rather reliably, so I’m not overly concerned.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Just a guess but something like this in a file systemd/user/pulseaudio.service:

[Unit]
Description=PulseAudio Sound System
Before=sound.target

[Service]
BusName=org.pulseaudio.Server
ExecStart=/usr/bin/pulseaudio
Restart=always

[Install]
WantedBy=session.target

I found this in a github repo which had additional files related to systemd setup.

The author of that repo, also wrote up on his blog this post: systemd as a session manager. This post details how to make use of the files in the repo.

Incidentally the files in the repo go here, ${HOME}/.config/systemd/user/.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x