2

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:

  1. Add "autospawn=no" to "/etc/pulse/client.conf" Add "autospawn=no" to "/var/lib/gdm3/.config/pulse/client.conf"
  2. Also add "daemon-binary = /bin/true" to client.conf
  3. "sudo rm -f /etc/xdg/autostart/pulseaudio.desktop"
  4. "sudo systemctl kill pulseaudio" (Returns "Failed to kill unit pulseaudio.service: Unit pulseaudio.service is not loaded.")
  5. Removing /etc/xdg/autostart/pulseaudio*
  6. systemctl --user stop pulseaudio.socket
  7. systemctl --user stop pulseaudio.service
  8. 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?

2
  • you find pulseaudio.service systemctl --user status pulseaudio.service – nobody Feb 3 '20 at 16:51
  • I'm not sure what you are asking - if you want the output of that command, it is: "pulseaudio.service - Sound Service Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled) Active: inactive (dead) " – David Ljung Madison Stellar Feb 6 '20 at 9:30
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.