diff options
author | Daniel Black <daniel.black@au.ibm.com> | 2017-05-08 16:36:37 +1000 |
---|---|---|
committer | Vicențiu-Marian Ciorbaru <vicentiu@mariadb.org> | 2019-09-20 08:59:18 +0300 |
commit | 75bcf1f9ad4a4bb5fa9cb8818abe6ace52e53d85 (patch) | |
tree | 49729a27b5db24a7149fc0014ca6da21db1bf51b /support-files/mariadb.service.in | |
parent | 4afe9d4b6dbffcebe8f9e5842fb79f0ff22b5aa0 (diff) | |
download | mariadb-git-75bcf1f9ad4a4bb5fa9cb8818abe6ace52e53d85.tar.gz |
MDEV-12646: systemd service file changes from Fedora
Include comment header that describes overrides.
Unit description now includes @VERSION@.
After=syslog.target removed - redunant
Add --basedir=@prefix to prevent /root/.my.cnf lookups. This is
placed after $MYSQLD_OPTIONS in case a user sets a --{no,}default
type options which has to be first in the mysqld arguements.
Additional changes to multi instance (support-files/mariadb@.service.in):
* added @SYSTEMD_EXECSTARTPRE@ / @SYSTEMD_EXECSTARTPOST@
* removed mariadb@bootstrap reference as galera_new_cluster as
it's a little too proment.
* use_galera_new_cluster.conf updated to override pre/post steps
to ensure it has no side effects
Signed-off-by: Daniel Black <daniel@linux.vnet.ibm.com>
Diffstat (limited to 'support-files/mariadb.service.in')
-rw-r--r-- | support-files/mariadb.service.in | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index ef9fa5c2a22..e7976a8f3e2 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -1,23 +1,28 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create a file "/etc/systemd/system/mariadb.service", +# containing +# .include /usr/lib/systemd/system/mariadb.service +# ...make your changes here... +# or create a file "/etc/systemd/system/mariadb.service.d/foo.conf", +# which doesn't need to include ".include" call and which will be parsed +# after the file mariadb.service itself is parsed. # -# /etc/systemd/system/mariadb.service +# For more info about custom unit files, see systemd.unit(5) or +# https://mariadb.com/kb/en/mariadb/systemd/ +# +# Copyright notice: # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. -# -# Thanks to: -# Daniel Black -# Erkan Yanar -# David Strauss -# and probably others [Unit] Description=MariaDB @VERSION@ database server Documentation=man:mysqld(8) Documentation=https://mariadb.com/kb/en/library/systemd/ After=network.target -After=syslog.target [Install] WantedBy=multi-user.target @@ -81,12 +86,15 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \ # Use the [Service] section and Environment="MYSQLD_OPTS=...". # This isn't a replacement for my.cnf. # _WSREP_NEW_CLUSTER is for the exclusive use of the script galera_new_cluster -ExecStart=@sbindir@/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION -@SYSTEMD_EXECSTARTPOST@ +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug https://bugzilla.redhat.com/show_bug.cgi?id=547485 +ExecStart=@sbindir@/mysqld $MYSQLD_OPTS --basedir=@prefix@ $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION # Unset _WSREP_START_POSITION environment variable. ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" +@SYSTEMD_EXECSTARTPOST@ + KillSignal=SIGTERM # Don't want to see an automated SIGKILL ever |