9

So I was trying to stop pulseaudio with pulseaudio -k, but it kept restarting "on its own", even though I have the configuration autospawn = no in place.

I'm pretty sure it's systemd that keeps restarting it, as instructed by /usr/lib/systemd/user/pulseaudio.service:

[Unit]
Description=Sound Service

[Service]
# Note that notify will only work if --daemonize=no
Type=notify
ExecStart=/usr/bin/pulseaudio --daemonize=no
Restart=on-failure

[Install]
Also=pulseaudio.socket
WantedBy=default.target

But the thing is, when I try to stop this service with systemctl stop pulseaudio.service, systemctl returns me the following:

Failed to stop pulseaudio.service: Unit pulseaudio.service not loaded.

How do I stop/disable this service?

14

To stop user services it's necessary to use the parameter --user:

systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
0
0

systemctl --user mask pulseaudio.socket helped me to make it not restart after killing it. changing autospawn and daemon-binary configs didn't help and disabling the service also didn't help.

source: https://winaero.com/blog/disable-pulseaudio-per-user-in-linux/

Also see https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/979

0
0

In the files:
/usr/lib/systemd/user/pulseaudio.socket
/usr/lib/systemd/user/pulseaudio.service
just below the line:
ConditionUser=!root
add:
ConditionUser=!gdm

That's it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.