You are not logged in.

#1 2026-03-18 19:16:07

Lojcs
Member
Registered: 2023-12-02
Posts: 3

[Solved] Systemctl can't locate mpd's user service unit.

Hi,

I'm trying to set up mpd on my computer. I can start the user service with

systemctl --user start mpd.service

but can't enable it with

systemctl --user enable mpd.service

It returns

Failed to enable unit: Unit /home/lojcs/.config/systemd/user/default.target.wants/mpd.service does not exist

so my issue seems to be different than this post.

Looking at the folder, there's indeed no unit file for it there and the `default.target.wants` folder also doesn't exist. The user service unit is installed at `/usr/lib/systemd/user/` just like the wiki page says it should. Was there supposed to be a symlink between the two directories that somehow got deleted? But then why can systemctl find it when just starting and not enabling?

I'm not specifically interested in running mpd as a user service; I've tried running it as a system service as well, but in that case I can't get it to read the config file at `/etc/mpd.conf`. It seems there's a dop-in file that changes the user of the system service to 'mpd', does that mean it's looking for a configuration file at `/home/mpd/.config/mpd/mpd.conf`? Edit: It seems it does read the file but can't open my music directory due to being a different user. Do I change the mpd user to my usersame? Any reason not to do that? Edit2: Tried it and it can't connect to JACK server if I do.

What is the canonical way of setting up mpd on Arch?

Last edited by Lojcs (2026-03-18 21:32:58)

Offline

#2 2026-03-18 21:07:16

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,431

Re: [Solved] Systemctl can't locate mpd's user service unit.

ls -lR /home/lojcs/.config/systemd
findmnt -T /home/lojcs/.config/systemd
systemctl -v --user enable mpd.service

Offline

#3 2026-03-18 21:16:40

Lojcs
Member
Registered: 2023-12-02
Posts: 3

Re: [Solved] Systemctl can't locate mpd's user service unit.

/home/lojcs/.config/systemd:
total 0
drwxr-xr-x 1 root root 32 Apr 28  2023 user/

/home/lojcs/.config/systemd/user:
total 4
-rw-r--r-- 1 root root 255 Apr 28  2023 sunshine.service
TARGET SOURCE                    FSTYPE OPTIONS
/home  /dev/mapper/root[/(home)] btrfs  rw,relatime,compress=zstd:8,ssd,discard=async,space_cache=v2,subvolid=27012,subvol=/(home)
Failed to enable unit: Unit /home/lojcs/.config/systemd/user/default.target.wants/mpd.service does not exist

Edit: Chowning ~.config/systemd fixed it. Strange that it says 'does not exist' and not 'could not write'. Thanks.

Last edited by Lojcs (2026-03-18 21:20:42)

Offline

#4 2026-03-18 21:30:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,431

Re: [Solved] Systemctl can't locate mpd's user service unit.

drwxr-xr-x 1 root root 32 Apr 28  2023 user/

Who owns that directory and what is your user allowed to do w/ it?

Edit: you figured wink
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Last edited by seth (2026-03-18 21:30:45)

Offline

Board footer

Powered by FluxBB