1# Copyright (c) 2015, 2021, Oracle and/or its affiliates. 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 35Alias=mysql.service 36 37[Service] 38User=@MYSQLD_USER@ 39Group=@MYSQLD_USER@ 40 41Type=forking 42 43PIDFile=@SYSTEMD_PID_DIR@/mysqld.pid 44 45# Disable service start and stop timeout logic of systemd for mysqld service. 46TimeoutSec=0 47 48# Execute pre and post scripts as root 49PermissionsStartOnly=true 50 51# Needed to create system tables 52ExecStartPre=@bindir@/mysqld_pre_systemd 53 54# Start main service 55ExecStart=@libexecdir@/mysqld --daemonize --pid-file=@SYSTEMD_PID_DIR@/mysqld.pid $MYSQLD_OPTS 56 57# Use this to switch malloc implementation 58EnvironmentFile=-/etc/sysconfig/mysql 59 60# Sets open_files_limit 61LimitNOFILE = 5000 62 63Restart=on-failure 64 65RestartPreventExitStatus=1 66 67PrivateTmp=false 68