diff -Nur e-smith-mysql-2.6.0.old/root/usr/lib/systemd/system/mysql.init.service e-smith-mysql-2.6.0/root/usr/lib/systemd/system/mysql.init.service --- e-smith-mysql-2.6.0.old/root/usr/lib/systemd/system/mysql.init.service 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-mysql-2.6.0/root/usr/lib/systemd/system/mysql.init.service 2020-12-07 22:37:53.569000000 -0500 @@ -0,0 +1,19 @@ +[Unit] +SourcePath=/etc/rc.d/init.d/mysql.init +Description=Koozali SME Server mysql DB injector for mariadb +After=mariadb.service +Requires=mariadb.service + +[Service] +Type=oneshot +Restart=no +TimeoutSec=10min +IgnoreSIGPIPE=no +KillMode=process +GuessMainPID=no +RemainAfterExit=yes +ExecStart=/etc/rc.d/init.d/mysql.init start +ExecStop=/etc/rc.d/init.d/mysql.init stop + +[Install] +WantedBy=sme-server.target diff -Nur e-smith-mysql-2.6.0.old/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade e-smith-mysql-2.6.0/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade --- e-smith-mysql-2.6.0.old/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade 2020-12-09 23:20:20.435000000 -0500 +++ e-smith-mysql-2.6.0/root/etc/e-smith/templates/etc/e-smith/sql/init/10mysql_upgrade 2020-12-09 23:23:42.874000000 -0500 @@ -1,9 +1,8 @@ #!/bin/sh /usr/bin/mysql_upgrade -P=$(cat /var/run/mariadb/mariadb.pid) /bin/rm /var/run/mariadb/mariadb.pid -kill -TERM $P +/usr/bin/systemctl restart mariadb.service for i in $(seq 1 20); do if [ -f /var/run/mariadb/mariadb.pid ] diff -Nur e-smith-mysql-2.6.0.old/createlinks e-smith-mysql-2.6.0/createlinks --- e-smith-mysql-2.6.0.old/createlinks 2020-12-13 17:05:15.553000000 -0500 +++ e-smith-mysql-2.6.0/createlinks 2020-12-13 17:07:11.467000000 -0500 @@ -67,9 +67,10 @@ } safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb"); - +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); # Move all database dumps except for mysql.dump to sql/init event_link("mysql-load-tables", $event, "40"); +templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event); # systemd-specific action mandatory for this package-update event event_link("systemd-reload", $event, "89");