|
|
4522a4 |
# It's not recommended to modify this file in-place, because it will be
|
|
|
4522a4 |
# overwritten during package upgrades. If you want to customize, the
|
|
|
4522a4 |
# best way is to use systemctl edit:
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# $ systemctl edit @DAEMON_NAME@.service
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# this will create file
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# /etc/systemd/system/@DAEMON_NAME@.service.d/override.conf
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# which be parsed after the file @DAEMON_NAME@.service itself is parsed.
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# For example, if you want to increase mysql's open-files-limit to 20000
|
|
|
4522a4 |
# add following when editing with command above:
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# [Service]
|
|
|
4522a4 |
# LimitNOFILE=20000
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# Or if you require to execute pre and post scripts in the unit file as root, set
|
|
|
4522a4 |
# PermissionsStartOnly=true
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# For more info about custom unit files, see systemd.unit(5) or
|
|
|
4522a4 |
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
|
|
|
4522a4 |
#
|
|
|
4522a4 |
# Don't forget to reload systemd daemon after you change unit configuration:
|
|
|
4522a4 |
# root> systemctl --system daemon-reload
|
|
|
4522a4 |
|
|
|
4522a4 |
[Unit]
|
|
|
4522a4 |
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
|
|
|
4522a4 |
After=syslog.target
|
|
|
4522a4 |
After=network.target
|
|
|
4522a4 |
|
|
|
4522a4 |
[Service]
|
|
|
4522a4 |
Type=notify
|
|
|
4522a4 |
User=mysql
|
|
|
4522a4 |
Group=mysql
|
|
|
4522a4 |
|
|
|
4522a4 |
ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
|
|
|
4522a4 |
ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
|
|
|
4522a4 |
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
|
|
4522a4 |
# per bug #547485
|
|
|
4522a4 |
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@
|
|
|
4522a4 |
ExecStopPost=@libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I
|
|
|
4522a4 |
|
|
|
4522a4 |
# Give a reasonable amount of time for the server to start up/shut down
|
|
|
4522a4 |
TimeoutSec=300
|
|
|
4522a4 |
|
|
|
4522a4 |
# Place temp files in a secure directory, not /tmp
|
|
|
4522a4 |
PrivateTmp=true
|
|
|
4522a4 |
|
|
|
4522a4 |
Restart=on-failure
|
|
|
4522a4 |
|
|
|
4522a4 |
RestartPreventExitStatus=1
|
|
|
4522a4 |
|
|
|
4522a4 |
# Sets open_files_limit
|
|
|
4522a4 |
LimitNOFILE = 10000
|
|
|
4522a4 |
|
|
|
4522a4 |
# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command.
|
|
|
4522a4 |
Environment=MYSQLD_PARENT_PID=1
|
|
|
4522a4 |
|
|
|
4522a4 |
[Install]
|
|
|
4522a4 |
WantedBy=multi-user.target
|