Fix mariadb and phpMyAdmin templates not change what shouldn't be

Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
2026-05-08 23:57:51 -04:00
parent d6d3b5082d
commit 1a75050dad
9 changed files with 150 additions and 15 deletions
@@ -32,15 +32,34 @@ Type=notify
User=mysql
Group=mysql
# Use an environment file to pass variable _WSREP_NEW_CLUSTER
EnvironmentFile=-/run/mariadb/wsrep-new-cluster
# Use an environment file to pass variable _WSREP_START_POSITION
EnvironmentFile=-/run/mariadb/wsrep-start-position
ExecStartPre=/usr/libexec/mariadb-check-socket
# '%n' expands to 'Full unit name'; man systemd.unit
ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n
# Perform automatic wsrep recovery. When server is started without wsrep,
# galera_recovery simply returns an empty string. In any case, however,
# the script is not expected to return with a non-zero status.
# It is always safe to remove /run/mariadb/wsrep-start-position
# environment file.
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
&& echo _WSREP_START_POSITION=$VAR > /run/mariadb/wsrep-start-position || exit 1"
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb@.service.d/MY_SPECIAL.conf
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=/usr/libexec/mariadbd --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
ExecStart=/usr/libexec/mariadbd --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
ExecStartPost=/usr/libexec/mariadb-check-upgrade
# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/rm -f /run/mariadb/wsrep-start-position
# Setting this to true can break replication and the Type=notify settings
# See also bind-address MariaDB option.
PrivateNetwork=false
@@ -54,14 +54,33 @@ Type=notify
User=mysql
Group=mysql
# Use an environment file to pass variable _WSREP_NEW_CLUSTER
EnvironmentFile=-/run/mariadb/wsrep-new-cluster
# Use an environment file to pass variable _WSREP_START_POSITION
EnvironmentFile=-/run/mariadb/wsrep-start-position
ExecStartPre=/usr/libexec/mariadb-check-socket --defaults-group-suffix=.%I
ExecStartPre=/usr/libexec/mariadb-prepare-db-dir --defaults-group-suffix=.%I %n
# Perform automatic wsrep recovery. When server is started without wsrep,
# galera_recovery simply returns an empty string. In any case, however,
# the script is not expected to return with a non-zero status.
# It is always safe to remove /run/mariadb/wsrep-start-position
# environment file.
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
&& echo _WSREP_START_POSITION=$VAR > /run/mariadb/wsrep-start-position || exit 1"
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/mariadb@.service.d/MY_SPECIAL.conf
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=/usr/libexec/mariadbd --defaults-group-suffix=.%I --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
ExecStart=/usr/libexec/mariadbd --defaults-group-suffix=.%I --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
ExecStartPost=/usr/libexec/mariadb-check-upgrade --defaults-group-suffix=.%I
# Unset _WSREP_START_POSITION environment variable.
ExecStartPost=/bin/rm -f /run/mariadb/wsrep-start-position
# Setting this to true can break replication and the Type=notify settings
# See also bind-address MariaDB option.
PrivateNetwork=false