Blame SOURCES/mysql.service.in

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