bd72127
# It's not recommended to modify this file in-place, because it will be
bd72127
# overwritten during package upgrades.  If you want to customize, the
bd72127
# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service",
bd72127
# containing
bd72127
#	.include /usr/lib/systemd/system/@DAEMON_NAME@.service
bd72127
#	...make your changes here...
bd72127
# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf",
bd72127
# which doesn't need to include ".include" call and which will be parsed
bd72127
# after the file @DAEMON_NAME@.service itself is parsed.
bd72127
#
bd72127
# For more info about custom unit files, see systemd.unit(5) or
bd72127
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
bd72127
bd72127
# For example, if you want to increase mysql's open-files-limit to 10000,
bd72127
# you need to increase systemd's LimitNOFILE setting, so create a file named
bd72127
# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing:
bd72127
#	[Service]
bd72127
#	LimitNOFILE=10000
bd72127
bd72127
# Or if you require to execute pre and post scripts in the unit file as root, set
bd72127
#       PermissionsStartOnly=true
bd72127
bd72127
# Note: /usr/lib/... is recommended in the .include line though /lib/...
bd72127
# still works.
bd72127
# Don't forget to reload systemd daemon after you change unit configuration:
bd72127
# root> systemctl --system daemon-reload
bd72127
bd72127
[Unit]
bd72127
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
bd72127
After=syslog.target
bd72127
After=network.target
bd72127
bd72127
[Service]
bd72127
Type=forking
bd72127
User=mysql
bd72127
Group=mysql
bd72127
PIDFile=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid
bd72127
bd72127
ExecStartPre=@libexecdir@/mysql-check-socket
bd72127
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
bd72127
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
bd72127
# per bug #547485
bd72127
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --daemonize --basedir=@prefix@ --pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid
bd72127
ExecStartPost=@libexecdir@/mysql-check-upgrade
bd72127
ExecStopPost=@libexecdir@/mysql-wait-stop
bd72127
bd72127
# Give a reasonable amount of time for the server to start up/shut down
bd72127
TimeoutSec=300
bd72127
bd72127
# Place temp files in a secure directory, not /tmp
bd72127
PrivateTmp=true
bd72127
bd72127
Restart=on-failure
bd72127
bd72127
RestartPreventExitStatus=1
bd72127
bd72127
[Install]
bd72127
WantedBy=multi-user.target