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