diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-06-14 16:10:45 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-06-17 12:26:25 +0200 |
commit | a4cc6fb91f3855e0ed803a6e1762440cfcf8cb5c (patch) | |
tree | 56fb2d34a58e301029c0745a215441fca4b4e49c /debian | |
parent | 0a43df4fbc78db89aef3fad525ba28cd2a010d50 (diff) | |
download | mariadb-git-a4cc6fb91f3855e0ed803a6e1762440cfcf8cb5c.tar.gz |
MDEV-15526 SysV init service deployed file '/etc/init.d/mysql' prevents systemctl disable command to work correctly (mariadb|mysql naming support) (debian/ubuntu)
mariadb service is controlled by systemd
Do not install SysV init script on Debian/Ubuntu in /etc/init.d/
put it in /usr/share/mysql in case the user would need it for something.
Use systemctl in pre/post scripts directly
without funky conditionals and wrapper scripts
Diffstat (limited to 'debian')
-rw-r--r-- | debian/additions/mysql.init (renamed from debian/mariadb-server-10.4.mysql.init) | 0 | ||||
-rw-r--r-- | debian/mariadb-server-10.4.install | 1 | ||||
-rw-r--r-- | debian/mariadb-server-10.4.postinst | 6 | ||||
-rw-r--r-- | debian/mariadb-server-10.4.postrm | 6 | ||||
-rw-r--r-- | debian/mariadb-server-10.4.preinst | 11 |
5 files changed, 5 insertions, 19 deletions
diff --git a/debian/mariadb-server-10.4.mysql.init b/debian/additions/mysql.init index bcc366e95b7..bcc366e95b7 100644 --- a/debian/mariadb-server-10.4.mysql.init +++ b/debian/additions/mysql.init diff --git a/debian/mariadb-server-10.4.install b/debian/mariadb-server-10.4.install index a9cbbfc8a99..e3a66b7b63f 100644 --- a/debian/mariadb-server-10.4.install +++ b/debian/mariadb-server-10.4.install @@ -2,6 +2,7 @@ debian/additions/debian-start etc/mysql debian/additions/debian-start.inc.sh usr/share/mysql debian/additions/echo_stderr usr/share/mysql debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d +debian/additions/mysql.init usr/share/mysql etc/apparmor.d/usr.sbin.mysqld lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf usr/bin/aria_chk diff --git a/debian/mariadb-server-10.4.postinst b/debian/mariadb-server-10.4.postinst index 4532085169e..42cbe394c28 100644 --- a/debian/mariadb-server-10.4.postinst +++ b/debian/mariadb-server-10.4.postinst @@ -17,11 +17,7 @@ ERR_LOGGER="logger -p daemon.err -t mariadb-server-$VER.postinst -i" set -o pipefail invoke() { - if [ -x /usr/sbin/invoke-rc.d ]; then - invoke-rc.d mysql $1 - else - /etc/init.d/mysql $1 - fi + systemctl $1 mysql } case "$1" in diff --git a/debian/mariadb-server-10.4.postrm b/debian/mariadb-server-10.4.postrm index bb9ba8cec68..3cbd3721414 100644 --- a/debian/mariadb-server-10.4.postrm +++ b/debian/mariadb-server-10.4.postrm @@ -12,11 +12,7 @@ MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" # is running! stop_server() { set +e - if [ -x /usr/sbin/invoke-rc.d ]; then - invoke-rc.d mysql stop - else - /etc/init.d/mysql stop - fi + systemctl stop mysql errno=$? set -e diff --git a/debian/mariadb-server-10.4.preinst b/debian/mariadb-server-10.4.preinst index 08e424bc712..032124c0fcc 100644 --- a/debian/mariadb-server-10.4.preinst +++ b/debian/mariadb-server-10.4.preinst @@ -20,25 +20,18 @@ mysql_upgradedir=/var/lib/mysql-upgrade # do it himself. No database directories should be removed while the server # is running! Another mysqld in e.g. a different chroot is fine for us. stop_server() { - if [ ! -x /etc/init.d/mysql ]; then return; fi - # Return immediately if there are no mysql processes running # as there is no point in trying to shutdown in that case. if ! pgrep mysqld > /dev/null; then return; fi set +e - if [ -x /usr/sbin/invoke-rc.d ]; then - cmd="invoke-rc.d mysql stop" - else - cmd="/etc/init.d/mysql stop" - fi - $cmd + systemctl stop mysql errno=$? set -e # 0=ok, 100=no init script (fresh install) if [ "$errno" != 0 -a "$errno" != 100 ]; then - echo "${cmd/ */} returned $errno" 1>&2 + echo "'systemctl stop mysql' returned $errno" 1>&2 echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2 echo "Stop it yourself and try again!" 1>&2 db_stop |