jcorporation / myMPD

myMPD is a standalone and mobile friendly web mpd client with a tiny footprint and advanced features.
https://jcorporation.github.io/myMPD/
GNU General Public License v3.0
418 stars 65 forks source link

First run fails #1143

Closed WallyDW closed 11 months ago

WallyDW commented 11 months ago

myMPD version: [e.g. 8.1.0] 13.0.0

Describe the bug I have installed the Debian apt package (mympd/unknown,now 13.0.0-1 amd64) from your repository. It installs fine, but starting it is another case. Try to start myMPD as a daemon with "systemctl start mympd" result in error at my setup (my port 80 is in use), but in journalctl the following line is printed. "NOTICE mympd Config dir: "/var/lib/mympd/config" created"

Looking for "/var/lib/mympd/config" shows that nothing gets created in /var/lib

Trying to solve it with "mympd -c" complains about a missing user mympd, which can be created manually. Then running "mympd -c" creates the /var/lib/mympd directory tree with all files.

Trying to start the daemon again after that with "systemctl start mympd" will now fail with permission issues. It looks like the systemd service file is configured with all kinds of protection settings, which means the /var/lib/mympd is supposed to be a link to /var/lib/private/mympd, but this can not be created because the entry already exist as a directory.

Deleting all files created then in both /var/lib and /var/cache, and then adding "-c" to the systemd service file ( /lib/systemd/system/mympd.service) finally creates the right structure. After that removing the "-c" option again makes it start up right.

A clear and concise description of what the bug is. It seems that no handling of first run as a daemon is in place.

To Reproduce See description above.

Expected behavior If running as a daemon and no configuration is found then create it. It would here probably be a good idea to either make sure that the daemon and the foreground running can use the same directory structure or make sure that they use distinct directory structure that are not interfering with each other.

A clear and concise description of what you expected to happen. See expected behavior.

Server plattform (please complete the following information):

Client plattform (please complete the following information): Not related

Debug logs (please attach if it can be useful)

Look at https://jcorporation.github.io/myMPD/debug

Configuration (please attach if it can be useful)

Additional context

Add any other context about the problem here.

jcorporation commented 11 months ago

It is described here: https://jcorporation.github.io/myMPD/configuration/configuration-files

If you think that the documentation is not sufficient, I am always happy to receive a pull request with improvements.