3

I currently have a wierd problem: i cant stop mpd from autostarting after reboot. I installed mpd from the official repositorys.

then i disabled it at systemd because i want it to run under the normal user and not as a service automatically:

sudo systemctl disable mpd

after chechking

sudo systemctl status mpd

it was inactive then.

but after the next reboot, systemd still spawns a process mpd.

only solution was:

sudo systemctl mask mpd

But the crazy thing is: another mpd process is still being spawned at startup, with the folder autostart under ~/config being empty and i also start with an empty session on bootup.

The final question: how do i really get rid of the autostart of mpd? i just want to start it manually, thats all.

1 Answer 1

3

You now disabled system-wide automatic launching of mpd. However, next to that, an automatic per-user startup is also automatically enabled in Ubuntu. Thus, if you disable the system wide mpd service, an autostart process will start a user-specific instance as soon as you log in.

To safely disable autostart:

  • Copy /etc/xdg/autostart/mpd.desktop to ~/.config/autostart/mpd.desktop
  • Edit ~/.config/autostart/mpd.desktop to change X-GNOME-Autostart-enabled=true to X-GNOME-Autostart-enabled=false, or delete the line
  • Edit or add a line `Hidden=true'

A local .desktop file takes priority over a system wide launcher. Instead of editing the system wide launcher, creating and changing a private copy is better practice because 1) you only affect your current user, 2) you do not need root permissions to customize the starter, and 3) your changes will not be overwritten by possible system updates.

3
  • 1
    Sadly, this wasnt the solution. Although i like your principle and also try follow it anywhere i can, it doesnt change the situation. Even after reinstalling, disabling and masking the service and doing the changes that you proposed: after startup 2 mpd processes spawn, 1 from systemd and 1 from my user. Running Kubuntu 19.04.
    – wg314
    Jun 3, 2019 at 22:01
  • In your question, you did not specify the DE, so the answer was for a standard Ubuntu desktop. However, I edited my answer: adding the line `Hidden=true' will disable autostart irrespective of the desktop environment.
    – vanadium
    Jun 4, 2019 at 6:45
  • 1
    I was also unable to get systemd to cease restarting mpd.
    – mcr
    Feb 2, 2020 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .