From 2e092583fea5087def69eb911bcf6e8f0d466331 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 18 Jul 2023 08:06:52 +1000 Subject: [PATCH] MDEV-31714 Debian 50-mariadb_safe.cnf has syslog enabled 50-mariadb_safe.cnf was only ever intended to be a reference file. With mariadbd-safe falling into disuse in Debian since systemd became a service it was assumed this files wasn't used except on a few old legacy init systems. Its assumed these users will have a configuration already set. It is however read by the mariabackup galera-sst script. This forks off the logger process to write the output to /dev/log, which on a systemd service the journalctl is reading anyway. The real harm is on containers where there is now a MariaDB operator that runs Galera based containers. In containers there is no /dev/log, so information gets lost. It would be much more direct just to go straight to stdout/error like what would happen without this configuration. Rather than risk the galera-sst scripts moving to the [mariadbd-safe] group name introduced in a1211a4eda9c7348295ce4a6fdfa8e94860e5e14, we remove the file for cleanness. --- .../mariadb.conf.d/50-mariadb_safe.cnf | 28 ------------------- debian/additions/mariadb.conf.d/50-server.cnf | 5 ++-- debian/mariadb-server.install | 1 - 3 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 debian/additions/mariadb.conf.d/50-mariadb_safe.cnf diff --git a/debian/additions/mariadb.conf.d/50-mariadb_safe.cnf b/debian/additions/mariadb.conf.d/50-mariadb_safe.cnf deleted file mode 100644 index 4467b087d9d..00000000000 --- a/debian/additions/mariadb.conf.d/50-mariadb_safe.cnf +++ /dev/null @@ -1,28 +0,0 @@ -# NOTE: THIS FILE IS READ ONLY BY THE TRADITIONAL SYSV INIT SCRIPT, NOT SYSTEMD. -# MARIADB SYSTEMD DOES _NOT_ UTILIZE MYSQLD_SAFE NOR READ THIS FILE. -# -# For similar behavior, systemd users should create the following file: -# /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf -# -# To achieve the same result as the default 50-mariadb_safe.cnf, please create -# /etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf -# with the following contents: -# -# [Service] -# User = mysql -# StandardOutput = syslog -# StandardError = syslog -# SyslogFacility = daemon -# SyslogLevel = err -# SyslogIdentifier = mariadbd -# -# For more information, please read https://mariadb.com/kb/en/mariadb/systemd/ - -[mariadbd-safe] -# This will be passed to all mysql clients -# It has been reported that passwords should be enclosed with ticks/quotes -# especially if they contain "#" chars... - -nice = 0 -skip_log_error -syslog diff --git a/debian/additions/mariadb.conf.d/50-server.cnf b/debian/additions/mariadb.conf.d/50-server.cnf index b634d0e05a4..c01a35f11f5 100644 --- a/debian/additions/mariadb.conf.d/50-server.cnf +++ b/debian/additions/mariadb.conf.d/50-server.cnf @@ -50,9 +50,8 @@ bind-address = 127.0.0.1 #general_log_file = /var/log/mysql/mysql.log #general_log = 1 -# When running under systemd, error logging goes via stdout/stderr to journald -# and when running legacy init error logging goes to syslog due to -# /etc/mysql/conf.d/mariadb.conf.d/50-mariadb_safe.cnf +# Error logging goes via stdout/stderr, which on systemd systems goes to +# journald. # Enable this if you want to have error logging into a separate file #log_error = /var/log/mysql/error.log # Enable the slow query log to see queries with especially long duration diff --git a/debian/mariadb-server.install b/debian/mariadb-server.install index 55cb9623b3a..763081b5d76 100644 --- a/debian/mariadb-server.install +++ b/debian/mariadb-server.install @@ -1,7 +1,6 @@ debian/additions/debian-start etc/mysql debian/additions/debian-start.inc.sh usr/share/mariadb debian/additions/echo_stderr usr/share/mariadb -debian/additions/mariadb.conf.d/50-mariadb_safe.cnf etc/mysql/mariadb.conf.d debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d debian/additions/source_mariadb.py usr/share/apport/package-hooks etc/apparmor.d/usr.sbin.mariadbd