How (where) to delay squeezebox service start?

I’m using OrangePi PC Plus for a Squeezebox server/player (with Squeezelite), and it works extremely well :slight_smile:

However, I do have one problem: the list of Internet radio stations is usually empty, until I restart LMS (Squeezebox) server.
I’ve had such problems before on other boards and architectures, and the reason is usually that the LMS (Squeezebox) server is started a bit early, and does not see the network yet (I’m using wifi, so that’s probably a part of the problem, since wifi also takes a while to start properly). Squeezebox server checks if “mysqueezebox.com” site is available upon startup, I think - if it doesn’t find it, it does not list some online services - Internet Radio being one of them.
So, in order to have the list of Internet radios available, you usually have to restart LMS server.
In order to avoid that hassle, I’m trying to delay the LMS (Squeezebox) service startup until wifi is online- but, for the life of me, can’t find how to do that!

So, I’d appreciate if anyone could point me in the right direction - i.e. how to delay the start of squeezebox service for a couple of seconds (I’ll try a delay of about 10 seconds, and see if that helps). In short, I need to make sure that squeezebox (LMS) service is started only after the wifi is connected…

Thanks for any pointers!

Regards,

Denis

Hi,

DietPi starts all services during boot, so you’d need to restart the service is question after this.

Add the following to end of /etc/rc.local (before the exit 0 line):

sleep 10 && systemctl restart squeezebox &