Hello,
From time to time, I am facing this situation: for any reason, my HDD is not present/mounted/etc… and, when mpd starts at boot, it justs erases the tag_cache file (because no music library can be seen).
So, when this happens, I need to rebuild again the tag_cache file, which can take a while.
What would be an easy way to prevent this?
In SystemV, I would modify manually /etc/init.d/mpd to check that the HDD can be seen before scanning it. But, with systemd, this would not work, because this script is not run.
I think that the mpd process is launched in /etc/systemd/system/multi-user.target.wants/mpd.service with this line:
ExecStart=/usr/bin/mpd --no-daemon
I could replace this with a simple script that checks the presence of HDD before running mpd. This is not very nice (I agree it is just an ugly solution…), but I think this would work.
Any “systemd” specialist here for a better way to do this? More “systemd oriented”?
Thanks in advance.
Denis