I’ve just migrated to OSMC from Raspbmc and am having a problem with systemd not starting a number of services (MySQL, OpenVPN, Samba and NFS) at boot time.
Most problematic of these are MySQL server and OpenVPN. The former as it prevents me seeing my library and the latter as it stops me fixing the former from outside of the house.
Looking at MySQL I see “[FAILED]” during the boot process and that tells me to run “systemctl status mysql.service” for details. When I run that I see the following:
osmc@osmc:~$ sudo systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Mon 2015-08-24 10:24:13 BST; 1min 39s ago
Process: 390 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
Aug 24 10:24:13 osmc /etc/init.d/mysql[1236]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Aug 24 10:24:13 osmc mysql[390]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Aug 24 10:24:13 osmc systemd[1]: mysql.service: control process exited, code=exited status=1
Aug 24 10:24:13 osmc systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Aug 24 10:24:13 osmc systemd[1]: Unit mysql.service entered failed state.
osmc@osmc:~$
which seems to tell me absolutely nothing except that it failed.
However when I start it manually, it works fine…
osmc@osmc:~$ sudo /etc/init.d/mysql start
[ ok ] Starting mysql (via systemctl): mysql.service.
osmc@osmc:~$ sudo systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: active (running) since Mon 2015-08-24 10:53:33 BST; 37s ago
Process: 1355 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mysql.service
├─1383 /bin/sh /usr/bin/mysqld_safe
└─1752 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socke...
Aug 24 10:53:33 osmc mysql[1355]: Starting MySQL database server: mysqld . . ..
Aug 24 10:53:33 osmc mysql[1355]: Checking for tables which need an upgrade, are corrupt or were
Aug 24 10:53:33 osmc mysql[1355]: not closed cleanly..
Aug 24 10:53:34 osmc /etc/mysql/debian-start[1812]: Upgrading MySQL tables if necessary.
Aug 24 10:53:36 osmc /etc/mysql/debian-start[1815]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Aug 24 10:53:36 osmc /etc/mysql/debian-start[1850]: Checking for insecure root accounts.
Aug 24 10:53:36 osmc /etc/mysql/debian-start[1855]: Triggering myisam-recover for all MyISAM tables
osmc@osmc:~$
As it clearly works manually, can anyone tell me how I can find out why it doesn’t work automatically at boot?