## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

[Unit]
Description=MySQL database server

[Service]
EnvironmentDirectory=env
ExecStartPre=./helper install_db
ExecStart=%pd --defaults-file="${defaultsfile:-/etc/%p/my.cnf}" ${optfile:+--defaults-extra-file "${optfile}"} --basedir="${basedir:-/usr}" --datadir="${datadir:-%S/%p}" --plugin-dir="${plugindir:-${basedir:-/usr}/lib/%p/plugin}" --socket="${socket:-/run/%pd/%pd.sock}" --port="${port:-3306}"
RuntimeDirectory=%pd
RuntimeDirectoryMode=0755
# We do not forcibly kill database servers, for better or for worse.
SendSIGKILL=false
User=%p
SessionLeader=yes
# This works around a security hole in MySQL where it opens sensitive files with predictable names in /tmp/ .
PrivateTmp=true
Restart=no

[Install]
WantedBy=server.target
