I'm running Kodi with MySQL on the same Rpi3 because I wanted to have my library synced across devices, so everything is now pointing to the rpi3 for the database.
The issue is that to allow Kodi on the Rpi3 to connect to MySQL on boot (after a reboot or restart of the device) it needs a couple settings modified in the kodi.service unit:
Here are the updated settings for /lib/systemd/system/kodi.service:
$this->bbcode_second_pass_code('', '
[Unit]
Description = Starts an instance of Kodi
After = remote-fs.target mysqld.service
Wait = mysqld.service
')
We need to put mysqld.service in the After and Wait sections so Kodi waits until MySQL is available to try to connect to the database, otherwise it starts with an error in the logs (regarding the connection) and an empty library.
I don't know how the package should manage this, as I understand that waiting for MySQL might not be the usual case, but after the upgrade to Kodi 17.1-3 the settings were overwritten. Kodi then lost the connection to the DB after the rpi3 rebooted, until I edited the service again.
Is there any way to have this into account in the package for those of us who use the Rpi as a database server and Kodi client?