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