1# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License, version 2.0,
5# as published by the Free Software Foundation.
6#
7# This program is also distributed with certain software (including
8# but not limited to OpenSSL) that is licensed under separate terms,
9# as designated in a particular file or component or in included license
10# documentation.  The authors of MySQL hereby grant you an additional
11# permission to link the program and your derivative works with the
12# separately licensed software that they have included with MySQL.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License, version 2.0, for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
22#
23# systemd service file for MySQL forking server
24#
25
26[Unit]
27Description=MySQL Server
28Documentation=man:mysqld(8)
29Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
30After=network.target
31After=syslog.target
32
33[Install]
34WantedBy=multi-user.target
35
36[Service]
37User=@MYSQLD_USER@
38Group=@MYSQLD_USER@
39
40Type=forking
41
42PIDFile=@SYSTEMD_PID_DIR@/mysqld-%i.pid
43
44# Disable service start and stop timeout logic of systemd for mysqld service.
45TimeoutSec=0
46
47# Execute pre and post scripts as root
48PermissionsStartOnly=true
49
50# Needed to create system tables
51ExecStartPre=@bindir@/mysqld_pre_systemd %I
52
53# Start main service
54ExecStart=@libexecdir@/mysqld --defaults-group-suffix=@%I --daemonize --pid-file=@SYSTEMD_PID_DIR@/mysqld-%i.pid $MYSQLD_OPTS
55
56# Use this to switch malloc implementation
57EnvironmentFile=-/etc/sysconfig/mysql
58
59# Sets open_files_limit
60LimitNOFILE = 5000
61
62Restart=on-failure
63
64RestartPreventExitStatus=1
65
66PrivateTmp=false
67