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