Blame SOURCES/mysql.service.in

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