You are not logged in.

#1 2020-09-23 17:36:55

Sonico98
Member
Registered: 2020-09-23
Posts: 2

MPD doesn't create the state file with proper permissions

I've reinstalled Arch recently, for the first time on a BTRFS partition. I copied my working mpd config to this new system, and it all works fine but the state file always gets created without permissions (no read, no write, no execute, anything). If I chmod the file, it loses all of its permissions whenever mpd writes to it: that is, whenever I start playing something. This results in mpd losing the last state when I reboot the machine, because the new mpd instance can't read the old file created with no permissions before the reboot. Just in case, the file does get created with my user and group as the owner, it just doesn't have permissions. Of course an option is to chmod the file every time the pc boots, but I'm more interested in not having to add that command to my ~/.xprofile and getting the file to be created properly. I've tried moving the file to another disk (which is, too, BTRFS) but it didn't work.

I'm starting mpd with a per-user configuration with

systemctl --user start mpd.service

The folder where the state file gets created has 777 permissions, as well as all of its parent folders (I know, this is not secure, but I did this in an attempt to get the file created with proper permissions). I also did a chmod +x on all the necessary folders and on the file, just in case.

This is my mpd config:

# Files and directories #######################################################
music_directory        "/mnt/Heaven/Music"
playlist_directory        "/mnt/Heaven/Documents/.config/mpd/playlists"
db_file            "/mnt/Heaven/Documents/.config/mpd/database"
log_file            "/home/sonico/.config/mpd/log"
pid_file            "/mnt/Heaven/Documents/.config/mpd/pid"
state_file            "/mnt/Heaven/Documents/.config/mpd/state"
sticker_file            "/mnt/Heaven/Documents/.config/mpd/sticker.sql"

# General music daemon options ################################################
user                "sonico"
group                "users"
restore_paused "yes"
save_absolute_paths_in_playlists    "yes"
metadata_to_use    "albumartist,albumartistsort,album,albumsort,artist,artistsort,title,track,name,genre,date,composer,disc"
auto_update    "yes"

# Input #######################################################################
input {
        plugin "curl"
}

# Audio Output ################################################################
audio_output {
    type        "httpd"
    name        "My HTTP Stream"
}

audio_output {
    type        "pulse"
    name        "My Pulse Output"
}

replaygain            "album"

As a note, I had all of the files (except the music directory) under ~/.config/mpd before, but the permissions problem was also present.

Offline

#2 2020-12-19 10:19:48

doaster
Member
Registered: 2020-04-21
Posts: 5

Re: MPD doesn't create the state file with proper permissions

Do you have another filesystem mounted to /mnt/Heaven ?
Try putting all your mpd files on your local filesystem and see if the issue is resolved if you haven't already done it.
If that works without problems, i guess there might be an incompatibilty between btrfs and the filesystem you have mounted.

Offline

#3 2021-01-06 02:31:49

Sonico98
Member
Registered: 2020-09-23
Posts: 2

Re: MPD doesn't create the state file with proper permissions

doaster wrote:

Do you have another filesystem mounted to /mnt/Heaven ?
Try putting all your mpd files on your local filesystem and see if the issue is resolved if you haven't already done it.
If that works without problems, i guess there might be an incompatibilty between btrfs and the filesystem you have mounted.

Both /mnt/Heaven and my local drive are BTRFS. And no, in fact I tried moving everything over to Heaven because it was not working with all the configs stored inside $HOME/.config/mpd.
Right now I have everything under $HOME, and I've tried copying the config over to /etc/mpd.conf as there seemed to be some conflict when loading the proper config file (I had port 8990 on one file, and 6600 on the other, and mpd would alternate those two between restarts). Sadly, this still didn't solve the issue.
In case it helps, this is my btrfs subvolumes layout

btrfs subvolume list /

ID 256 gen 37577 top level 5 path root
ID 257 gen 35705 top level 5 path home
ID 259 gen 12 top level 5 path .snapshots
ID 262 gen 34 top level 256 path var/lib/portables
ID 264 gen 35 top level 256 path var/lib/machines
ID 331 gen 37577 top level 257 path home/sonico.homedir
ID 332 gen 37577 top level 256 path var/log
ID 333 gen 37571 top level 256 path var/cache/pacman/pkg

The .homedir volume is because I moved to systemd-homed recently.

Offline

#4 2021-02-13 16:22:20

doaster
Member
Registered: 2020-04-21
Posts: 5

Re: MPD doesn't create the state file with proper permissions

That shouldn't happen, mpd reads only 1 config file. To do this it looks in (left first): $XDG_CONFIG_HOME/mpd/mpd.conf > ~/.mpdconf > ~/.mpd/mpd.conf > /etc/mpd.conf
Is it possible that you have multiple mpd processes started?

If your problem persist, consider filing a bug report at https://github.com/MusicPlayerDaemon/MPD/issues/, for how to do this best see https://www.musicpd.org/doc/html/user.h … rting-bugs.
I highly doubt that there is a bug in the kernel or btrfs.

Offline

Board footer

Powered by FluxBB