[monitoring-plugins] ci: detect MariaDB socket path dynamically

Lorenz Kästle git at monitoring-plugins.org
Wed Nov 4 10:30:13 CET 2026


    Module: monitoring-plugins
    Branch: master
    Commit: 25906bce1cfa64fd699b9a09a00826a2bc59a35d
    Author: Christopher Kreft <email at christopherkreft.de>
 Committer: Lorenz Kästle <lorenz.kaestle at mailbox.org>
      Date: Tue Nov  3 10:48:26 2026 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=25906bce

ci: detect MariaDB socket path dynamically

Debian changed the default socket to /run/mariadbd/mysqld.sock
to support co-installation of MySQL and MariaDB.

Query @@socket and update NPTest.cache during CI preparation
to support both old and new socket paths.

Debian patch:
https://sources.debian.org/patches/mariadb/1%3A11.8.9%2Bds-4/set-default-rundatadir-to-run-mariadb.patch/

---

 .github/prepare_debian.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh
index 417b5a06..b372b3f6 100755
--- a/.github/prepare_debian.sh
+++ b/.github/prepare_debian.sh
@@ -103,6 +103,9 @@ service squid start
 # mariadb
 service mariadb start || service mysql start
 mysql -e "create database IF NOT EXISTS test;" -uroot
+# Socket paths differ between Debian/MariaDB versions.
+mysql_socket=$(mysql -uroot -Nse 'SELECT @@socket')
+sed -i "s|^  'NP_MYSQL_SOCKET' => .*|  'NP_MYSQL_SOCKET' => '$mysql_socket',|" .github/NPTest.cache
 
 # ldap
 sed -e 's/cn=admin,dc=nodomain/'$(/usr/sbin/slapcat|grep ^dn:|awk '{print $2}')'/' -i .github/NPTest.cache



More information about the Commits mailing list