mirror of
https://abf.rosa.ru/djam/mariadb.git
synced 2025-02-23 14:42:48 +00:00

This package in ROSA was maintained quite poorly, had only a few users and lacked such important features as running multiple instances of MySQL server (mysqld@.service) and scripts for automatic upgrade to newer versions. Also upstream has renamed libraries, now there is mysql-connector-c with devel parts. /srv/mysql is also rather strange, /var/lib/mysql is more common. Let's rebase to a well-maintained package from openSUSE. It is being done in a not released platform without any compatibility for smooth upgrades fromt he old package. The new one has a lower epoch, automatic upgrades won't be done. High epoch is not needed anymore: mysql-community has not been merged from abf.io/rosaserver to abf.io/import, and now the library in mariadb is called libmariadbclient, not libmysqlclient (but compatibility symlinks do exist), so there are no duplicated provides and so there is no need in a high epoch. This commits just imports from openSUSE's SRPM without any changes, the following one will adapt it for ROSA. It will allow to easily see the diff against the openSUSE's package to easify further syncs and contibuting back to SUSE (https://bugzilla.opensuse.org/show_bug.cgi?id=1182218)
71 lines
2.1 KiB
SYSTEMD
71 lines
2.1 KiB
SYSTEMD
# It's not recommended to modify this unit file because your changes
|
|
# would be overwritten during the package update.
|
|
#
|
|
# However, there are 2 methods how to customize this unit file:
|
|
#
|
|
# 1) Copy this unit file from /usr/lib/systemd/system to
|
|
# /etc/systemd/system and modify the chosen settings.
|
|
#
|
|
# 2) Create a directory named mariadb.service.d/ within /etc/systemd/system
|
|
# and place a drop-in file name.conf there that only changes the specific
|
|
# settings one is interested in.
|
|
#
|
|
# see systemd.unit(5) for details
|
|
#
|
|
# Example - increasing of the TimeoutSec= limit
|
|
# mkdir /etc/systemd/system/mariadb.service.d
|
|
# cat > /etc/systemd/system/mariadb.service.d/timeout.conf << EOF
|
|
# [Service]
|
|
# TimeoutSec=600
|
|
# EOF
|
|
|
|
[Unit]
|
|
Description=MariaDB database server
|
|
Documentation=man:mysqld(8)
|
|
Documentation=https://mariadb.com/kb/en/library/systemd/
|
|
Conflicts=mariadb.target
|
|
After=network.target time-sync.target
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=mysql.service
|
|
|
|
[Service]
|
|
ExecStartPre=@LIBEXECDIR@/mysql/mysql-systemd-helper install
|
|
ExecStartPre=@LIBEXECDIR@/mysql/mysql-systemd-helper upgrade
|
|
ExecStart=@LIBEXECDIR@/mysql/mysql-systemd-helper start
|
|
|
|
Type=notify
|
|
User=mysql
|
|
Group=mysql
|
|
|
|
KillSignal=SIGTERM
|
|
|
|
# Don't want to see an automated SIGKILL ever
|
|
SendSIGKILL=no
|
|
|
|
# Restart crashed server only, on-failure would also restart, for example, when
|
|
# my.cnf contains unknown option
|
|
Restart=on-abort
|
|
RestartSec=5s
|
|
|
|
# Configures the time to wait for start-up/stop
|
|
TimeoutSec=300
|
|
|
|
# CAP_IPC_LOCK To allow memlock to be used as non-root user
|
|
# CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0
|
|
# does nothing for non-root, not needed if /etc/shadow is u+r
|
|
# CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason
|
|
CapabilityBoundingSet=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE
|
|
|
|
# Prevent writes to /usr, /boot, and /etc
|
|
ProtectSystem=full
|
|
|
|
# Prevent accessing /home, /root and /run/user
|
|
ProtectHome=true
|
|
|
|
# Execute pre and post scripts as root, otherwise it does it as User=
|
|
PermissionsStartOnly=true
|
|
|
|
UMask=007
|
|
|