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