[kodi-rbp] systemd kodi.service unit and mysqld

Problems with packages? Post here, using [tags] of the package name.

[kodi-rbp] systemd kodi.service unit and mysqld

Postby sudcrow » Tue May 02, 2017 4:11 am

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?
sudcrow
 
Posts: 4
Joined: Sat Feb 13, 2016 3:15 am

Re: [kodi-rbp] systemd kodi.service unit and mysqld

Postby sudcrow » Tue May 16, 2017 11:25 pm

I had added this to the Kodi wiki page at the Arch Linux wiki:
https://wiki.archlinux.org/index.php/Ko ... SQL_server

But someone removed (apparently the maintainer of the kodi-standalone-service in the AUR which seems to be the same of the package here), and got me thinking if it was the right place to put the info. This is required due to the kodi-rbp package creating the service file and overwriting it on upgrade.

Everytime I upgrade kodi-rbp I have to go to the service file and write this changes so Kodi will be able to read the DB at boot. I know it's not "usual" to reboot the device, but it happens, and If you upgrade, Kodi boots with an empty DB.

Couldn't find the bug tracker for ALARM, so I ask here again. I will be contacting the maintainer also just in case.
sudcrow
 
Posts: 4
Joined: Sat Feb 13, 2016 3:15 am

Re: [kodi-rbp] systemd kodi.service unit and mysqld

Postby pepedog » Wed May 17, 2017 4:50 pm

Try this
$this->bbcode_second_pass_code('', 'systemctl edit kodi')
and paste in
$this->bbcode_second_pass_code('', '[Unit]
After = remote-fs.target mysqld.service
Wait = mysqld.service')
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: [kodi-rbp] systemd kodi.service unit and mysqld

Postby graysky » Wed May 17, 2017 7:11 pm

All - There is no need to modify either kodi.service or mariadb.service for this to work. I have a RPi3 serving up mariadb and running kodi (connecting to that db) without any modifications to the package provided defaults. I simply enabled both to start at boot and they just work™.

$this->bbcode_second_pass_code('', '% uname -a
Linux brassmonkey 4.9.28-1-ARCH #1 SMP Tue May 16 00:52:33 UTC 2017 armv7l GNU/Linux')

$this->bbcode_second_pass_code('', '% % find /etc/systemd/system/multi-user.target.wants -printf "%f\n"
multi-user.target.wants
systemd-networkd.service
kodi.service
systemd-resolved.service
cronie.service
haveged.service
mariadb.service
remote-fs.target
sshd.service
nfs-server.service
ufw.service')
graysky
Developer
 
Posts: 1731
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000


Return to Packages

Who is online

Users browsing this forum: No registered users and 30 guests