Hi guys, im using wifi to connect and it is working ok.
Only issue i have is when the pi starts, it does not connect for a while and so it cant connect tot he mysql database in time. If i goto power and hit exit and osmc reboots, it then works fine and shows my libraries etc.
Is there a way to make kodi refresh in a sense once wifi connects at a later stage?
If kodi waits for network-startup to finish, it has no effect on whether or not mysql-server is started up properly. At the moment, I have to restart mysql-server after every reboot, as it consistently fails to start up properly!
What you’re talking about is a completely separate issue to the original poster.
He has his mysql sever running on another machine, thus OSMC must wait for the wifi connection to come up before launching Kodi. This is achieved by the wait for network option in the networking GUI. (which didn’t exist at the time of the original post)
What you are talking about is waiting for a locally running mysql server to finish starting before Kodi is launched. This is done differently.
Even though mysql may be a legacy init script (I haven’t looked) you should still be able to use an After clause in the mediacenter service to make it wait for mysql to start. Can you try this for me:
The after line should obviously match the service name if it is a systemd service, however if it is a legacy init script service, find the service name and append .service on the end. (Please let me know what the service name is, if I don’t get time to check myself)
Please try this and let me know if it works because if it does we are talking about adding an After dependency into the standard mediacenter service unit.
This works because if the mysql service is disabled or does not exist it is ignored and does not delay Kodi launch, but if the service is installed and enabled it would automatically delay Kodi until mysql loads without any manual user configuration.
I had the same problem and therefore i’m bringing this thread up again.
Fortunately the way dbmandrake describes seem to work. I just had to change the service name from “mysql-server” to just “mysql”.
With 4 or 5 reboots now i didn’t have the problem of the missing connection to the locally installed mysql database on my pi2.
Thx for the help!
If someone else could please confirm this so the developer can put this in one of the next updates.
How did you install mysql ? Just through apt-get install mysql ?
On my system, the mysql service (a legacy /etc/init.d/ service) is just called mysql. Therefore the line After = mysql.service, which is what we currently have in the mediacenter service is correct:
So I’m curious to know why your service was called mysql-server and not mysql. We can easily add mysql-server.service to the list as well, if some methods of installing mysql result in this service name. It does no harm to list a service that does not exist in an After line, it only has any effect if the service does exist and is enabled.
You misunderstood me, i was referring to your post from may where YOU wrote “mysql-server”.
Anyway, before i created the directory “mediacenter.service.d” in the given pathand the local.conf itself (as given with your posting from may) i had the problem after about 4 of 5 restarts. Both the directory and the file didn’t exist beforehand. So the general setting in the current service didn’t seem to work for me.
Or do i get something completely wrong?
In this case sorry. I’m not native english.
Yes of course. But it’s gonna take some hours as i’m still at work.
Btw, big thx for the efforts of you and the others for this great project. Without any knowledge of raspberries and the whole unix-stuff i discovered this world six months ago. Now after this time i’m already running 4 devices and i’m almost happy. Especially since i noob managed to get the squeezebox stuff running since last werkend, giving me sync-audio playback in all rooms without loosing the raspbmc/osmc stuff.
I’m gonna delete the (as I know now) unnecessary local.conf and dig a little deeper in the logs.
If I find something or can’t sort things out by yself I’m gonna start a new thread as here it is offtopic.