When I boot (Ubuntu 18.04), systemd is starting up pulseaudio under user gdm. I don't want that - I want to run pulseaudio as my user, because of problems with pulseaudio under gdm and mpd.
So I am trying to kill it, and nothing will kill this monster. It keeps respawning. People have asked this question before, and all of the following solutions have failed:
- Add "autospawn=no" to "/etc/pulse/client.conf" Add "autospawn=no" to "/var/lib/gdm3/.config/pulse/client.conf"
- Also add "daemon-binary = /bin/true" to client.conf
- "sudo rm -f /etc/xdg/autostart/pulseaudio.desktop"
- "sudo systemctl kill pulseaudio" (Returns "Failed to kill unit pulseaudio.service: Unit pulseaudio.service is not loaded.")
- Removing /etc/xdg/autostart/pulseaudio*
- systemctl --user stop pulseaudio.socket
- systemctl --user stop pulseaudio.service
- systemctl disable pulseaudio
According to pstree, it keeps getting restarted by systemd with user gdm, if I kill it (as root) the process dies, and systemd just respawns it.
But I can't figure out why systemd is starting it:
% systemctl --type=service | grep pulse
% systemctl list-units --type=service | grep pulse
In fact, systemctl doesn't even think it's running:
% systemctl | grep pulse
% systemctl --state=running | grep pulse
Which is why:
% systemctl disable pulseaudio
Failed to disable unit: Unit file pulseaudio.service does not exist.
And systemd doesn't admit to starting it:
% systemd --test | grep -i pulse
Loaded units and determined initial transaction in 27ms.
But pstree tells us that it's lying:
% pstree
.....
|-systemd-+-(sd-pam)
...
| |-pulseaudio---{pulseaudio}
It's also not listed in the init.d or Xsession.d scripts:
% ls /etc/init.d/*pulse*
ls: cannot access '/etc/init.d/*pulse*': No such file or directory
% ls /etc/X11/Xsession.d/*pulse*
ls: cannot access '/etc/X11/Xsession.d/*pulse*': No such file or directory
Although this file does exist:
/var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket Which claims "WantedBy=sockets.target" whatever that means..
I think it might be partially a path problem with systemd - it's not in the /etc/systemd path:
% find /etc/systemd/ -name '*pulse*'
But:
% find /usr/lib/systemd | grep pulseaudio
/usr/lib/systemd/user/pulseaudio.socket
/usr/lib/systemd/user/pulseaudio.service
I noticed that someone else had this bug on redhat:
https://bugzilla.redhat.com/show_bug.cgi?id=1635119
Frustratingly it was closed as NOTABUG without an explanation.
What does it take to kill this process and keep it killed, without some hack like temporarily moving the binary?
In the files:
Just below the line:
Add:
That's it!