Page 1 of 1

mpd not saving playist on exit

Posted: April 22nd, 2019, 6:32 pm
by mzagrabe
Greetings,

I spawn mpd automatically via the session manager when I log in to my graphical desktop. Things work good, but I am expecting the current playlist mpd has to be reloaded when I restart the computer and mpd respawns. When mpd loads, the playlist is empty.

Is there a way to get mpd to save and then reload the playlist the next time it starts?

Thanks!

-m

Re: mpd not saving playist on exit

Posted: April 23rd, 2019, 10:17 am
by max
Yes.

(Before you complain: this is an exact and complete answer to your question. If that doesn't satisfy you, ask a different question. Before you do that, read https://www.musicpd.org/help/)

Re: mpd not saving playist on exit

Posted: April 23rd, 2019, 3:16 pm
by mzagrabe
Thanks for the hint, Max!

For posterity, there is a state_file setting:

state_file <file>
This specifies if a state file is used and where it is located. The state of mpd will be saved to this file when mpd is terminated by a
TERM signal or by the "kill" command. When mpd is restarted, it will read the state file and restore the state of mpd (including the
playlist).

Cheers,

-m