Jean-Philippe Pialasse afcd41481e * Fri Mar 07 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-9.sme
- upgrade to support mariadb 11.4 [SME: 12930]
  move mariadb-upgrade to mysql.init unit, remove duplicate in 00_restore_dumped_dbs and 10mysql_upgrade
  add our tmp.d
  add post action dnf script
  update mariadb.service.d/  content
  set default to utfmb4
- TODO mysql.dump filtering [SME: 12592]
- TODO feedback plugin [SME: 12897]

* Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
- prestart script requires daemontools bins [SME: 12566]
2025-03-07 22:32:45 -05:00

44 lines
1.2 KiB
Plaintext

[Unit]
Description=MariaDB database server
After=syslog.target
After=network.target
[Service]
#allow to run as root pre and post
PermissionsStartOnly=true
#reset
ExecStartPre=
ExecStartPre=/usr/bin/install -d /var/run/mariadb -o mysql -g mysql -m 0755
# add mariadb >=10.6 specifics
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
&& systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
#ours : we need root user as + and ! are not yet supported
#ExecStartPre=/usr/libexec/mysql-check-socket
ExecStartPre=-/sbin/e-smith/service-status mariadb
ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql.private/set.password
ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf
ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf
# create db here if needed
ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize
#reset
ExecStart=
#ours
ExecStart=/usr/sbin/mariadbd \
--defaults-file=/etc/my.cnf \
--basedir=/usr \
--datadir=/var/lib/mysql \
--user=mysql \
--pid-file=/var/run/mariadb/mariadb.pid
ExecStartPost=-/sbin/e-smith/systemd/mariadb-post
[Install]
WantedBy=sme-server.target