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