2caa773
# Multi instance version of mariadb. For if you run mutiple verions at once.
2caa773
# Also used for @DAEMON_NAME@@bootstrap to bootstrap Galera.
2caa773
#
2caa773
# To use multi instance variant, use [mysqld.INSTANCENAME] as sections in my.cnf
2caa773
# and start the service via:
2caa773
#	systemctl start @DAEMON_NAME@@{instancename}.server
2caa773
#
2caa773
# It's not recommended to modify this file in-place, because it will be
2caa773
# overwritten during package upgrades.  If you want to customize, the
2caa773
# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service",
2caa773
# containing
2caa773
#	.include /usr/lib/systemd/system/@DAEMON_NAME@.service
2caa773
#	...make your changes here...
2caa773
# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf",
2caa773
# which doesn't need to include ".include" call and which will be parsed
2caa773
# after the file @DAEMON_NAME@.service itself is parsed.
2caa773
#
2caa773
# For more info about custom unit files, see systemd.unit(5) or
2caa773
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
2caa773
2caa773
# For example, if you want to increase mysql's open-files-limit to 10000,
2caa773
# you need to increase systemd's LimitNOFILE setting, so create a file named
2caa773
# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing:
2caa773
#	[Service]
2caa773
#	LimitNOFILE=10000
2caa773
2caa773
# Note: /usr/lib/... is recommended in the .include line though /lib/...
2caa773
# still works.
2caa773
# Don't forget to reload systemd daemon after you change unit configuration:
2caa773
# root> systemctl --system daemon-reload
2caa773
2caa773
# Use [mysqld.INSTANCENAME] as sections in my.cnf to configure this instance.
2caa773
2caa773
[Unit]
2caa773
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
f6397a1
Documentation=man:mysqld(8)
f6397a1
Documentation=https://mariadb.com/kb/en/library/systemd/
2caa773
After=network.target
2caa773
f6397a1
[Install]
f6397a1
WantedBy=multi-user.target
f6397a1
Alias=mysql.service
f6397a1
Alias=mysqld.service
f6397a1
2caa773
[Service]
2caa773
Type=notify
2caa773
User=mysql
2caa773
Group=mysql
2caa773
036ca48
ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
036ca48
ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
2caa773
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
2caa773
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
2caa773
# per bug #547485
2caa773
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
036ca48
ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
2caa773
2caa773
# Setting this to true can break replication and the Type=notify settings
2caa773
# See also bind-address mysqld option.
2caa773
PrivateNetwork=false
2caa773
2caa773
KillMode=process
2caa773
KillSignal=SIGTERM
2caa773
2caa773
# Don't want to see an automated SIGKILL ever
2caa773
SendSIGKILL=no
2caa773
2caa773
# Restart crashed server only, on-failure would also restart, for example, when
2caa773
# my.cnf contains unknown option
2caa773
Restart=on-abort
2caa773
RestartSec=5s
2caa773
2caa773
UMask=007
2caa773
2caa773
# Give a reasonable amount of time for the server to start up/shut down
2caa773
TimeoutSec=300
2caa773
2caa773
# Place temp files in a secure directory, not /tmp
2caa773
PrivateTmp=true