[debian-mysql] Bug#1061348: mariadb: install PAM modules and systemd unit files into /usr

Michael Biebl biebl at debian.org
Mon Jan 22 22:09:09 GMT 2024


Source: mariadb
Version: 1:10.11.6-2
Severity: normal
Tags: patch
User: helmutg at debian.org
Usertags: dep17m2

We want to finalize the /usr-merge via DEP17 by moving all files to
/usr. mariadb installs the following files into /lib:

$ apt-file search -x ^/lib | grep mariadb
mariadb-server: /lib/systemd/system/mariadb at bootstrap.service.d/use_galera_new_cluster.conf
mariadb-server: /lib/systemd/system/mysql.service
mariadb-server: /lib/systemd/system/mysqld.service
mariadb-server: /lib/x86_64-linux-gnu/security/pam_user_map.so


These should be moved into the respective directories in /usr/
I notice, that some of the systemd unit files are already correctly
installed:

$ apt-file list mariadb-server | grep /usr/lib/systemd
mariadb-server: /usr/lib/systemd/system/mariadb.service
mariadb-server: /usr/lib/systemd/system/mariadb.socket
mariadb-server: /usr/lib/systemd/system/mariadb at .service
mariadb-server: /usr/lib/systemd/system/mariadb at .socket

This discrepancy is probably a result of some files being installed by
debhelper and some by the upstream build system.

Eventually this would make sense to unify and maybe switch to
dh_installsystemd and a newer compat version.

I tried to keep the changes minimal for this patch though.
Please find it attached.  It has been build-tested.

$ dpkg -c mariadb-server_10.11.6-2.1_amd64.deb | grep -E '(systemd|security)'
drwxr-xr-x root/root         0 2024-01-22 22:30 ./etc/security/
-rw-r--r-- root/root       247 2023-11-08 16:46 ./etc/security/user_map.conf
drwxr-xr-x root/root         0 2024-01-22 22:30 ./usr/lib/systemd/
drwxr-xr-x root/root         0 2024-01-22 22:30 ./usr/lib/systemd/system/
-rw-r--r-- root/root      5865 2024-01-22 22:30 ./usr/lib/systemd/system/mariadb.service
-rw-r--r-- root/root       571 2024-01-22 22:30 ./usr/lib/systemd/system/mariadb.socket
-rw-r--r-- root/root     10007 2024-01-22 22:30 ./usr/lib/systemd/system/mariadb at .service
-rw-r--r-- root/root       578 2024-01-22 22:30 ./usr/lib/systemd/system/mariadb at .socket
drwxr-xr-x root/root         0 2024-01-22 22:30 ./usr/lib/systemd/system/mariadb at bootstrap.service.d/
-rw-r--r-- root/root       676 2023-11-08 16:46 ./usr/lib/systemd/system/mariadb at bootstrap.service.d/use_galera_new_cluster.conf
drwxr-xr-x root/root         0 2024-01-22 22:30 ./usr/lib/x86_64-linux-gnu/security/
-rw-r--r-- root/root     14176 2024-01-22 22:30 ./usr/lib/x86_64-linux-gnu/security/pam_user_map.so
lrwxrwxrwx root/root         0 2024-01-22 22:30 ./usr/lib/systemd/system/mysql.service -> mariadb.service
lrwxrwxrwx root/root         0 2024-01-22 22:30 ./usr/lib/systemd/system/mysqld.service -> mariadb.service



Note: this should not be backported to bookworm. If you intend to
backport, please revert this change or use dh_movetousr instead.

If your package will change for the t64 transition or otherwise
rename/split/move its binaries (packages) during trixie, please
then upload to experimental and get in touch with the UsrMerge
driver, please see the wiki [1].

Michael

[1] https://wiki.debian.org/UsrMerge
-------------- next part --------------
diff -Nru mariadb-10.11.6/debian/changelog mariadb-10.11.6/debian/changelog
--- mariadb-10.11.6/debian/changelog	2024-01-05 09:32:12.000000000 +0100
+++ mariadb-10.11.6/debian/changelog	2024-01-22 22:30:08.000000000 +0100
@@ -1,3 +1,10 @@
+mariadb (1:10.11.6-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Install PAM module and systemd files into /usr. (Closes: #-1)
+
+ -- Michael Biebl <biebl at debian.org>  Mon, 22 Jan 2024 22:30:08 +0100
+
 mariadb (1:10.11.6-2) unstable; urgency=medium
 
   [ Otto Kek?l?inen ]
diff -Nru mariadb-10.11.6/debian/mariadb-server.install mariadb-10.11.6/debian/mariadb-server.install
--- mariadb-10.11.6/debian/mariadb-server.install	2024-01-04 11:36:14.000000000 +0100
+++ mariadb-10.11.6/debian/mariadb-server.install	2024-01-22 22:27:28.000000000 +0100
@@ -8,10 +8,10 @@
 etc/apparmor.d/usr.sbin.mariadbd
 etc/logrotate.d/mariadb
 etc/security/user_map.conf
-lib/*/security/pam_user_map.so
-[linux-any] lib/systemd/system/mariadb at bootstrap.service.d/use_galera_new_cluster.conf
-[linux-any] lib/systemd/system/mysql.service
-[linux-any] lib/systemd/system/mysqld.service
+usr/lib/*/security/pam_user_map.so
+[linux-any] usr/lib/systemd/system/mariadb at bootstrap.service.d/use_galera_new_cluster.conf
+[linux-any] usr/lib/systemd/system/mysql.service
+[linux-any] usr/lib/systemd/system/mysqld.service
 usr/bin/aria_chk
 usr/bin/aria_dump_log
 usr/bin/aria_ftdump
diff -Nru mariadb-10.11.6/debian/mariadb-server.lintian-overrides mariadb-10.11.6/debian/mariadb-server.lintian-overrides
--- mariadb-10.11.6/debian/mariadb-server.lintian-overrides	2024-01-04 11:36:14.000000000 +0100
+++ mariadb-10.11.6/debian/mariadb-server.lintian-overrides	2024-01-22 22:30:08.000000000 +0100
@@ -9,8 +9,8 @@
 # Intentional in-context documentation
 package-contains-documentation-outside-usr-share-doc [usr/share/mysql/errmsg-utf8.txt]
 # mysql(d).service are symlinks to mariadb.service, and there is indeed a init.d/mariadb shipped
-package-supports-alternative-init-but-no-init.d-script [lib/systemd/system/mysql.service]
-package-supports-alternative-init-but-no-init.d-script [lib/systemd/system/mysqld.service]
+package-supports-alternative-init-but-no-init.d-script [usr/lib/systemd/system/mysql.service]
+package-supports-alternative-init-but-no-init.d-script [usr/lib/systemd/system/mysqld.service]
 # Intentionally symlinks mysql->mariadb
-service-file-is-not-a-file [lib/systemd/system/mysql.service]
-service-file-is-not-a-file [lib/systemd/system/mysqld.service]
+service-file-is-not-a-file [usr/lib/systemd/system/mysql.service]
+service-file-is-not-a-file [usr/lib/systemd/system/mysqld.service]
diff -Nru mariadb-10.11.6/debian/not-installed mariadb-10.11.6/debian/not-installed
--- mariadb-10.11.6/debian/not-installed	2024-01-04 11:36:14.000000000 +0100
+++ mariadb-10.11.6/debian/not-installed	2024-01-22 22:30:08.000000000 +0100
@@ -5,12 +5,12 @@
 etc/mysql/mariadb.conf.d/enable_encryption.preset # Debian packaging uses files from debian/additions/mariadb.cnf.d/
 etc/mysql/mariadb.conf.d/mysql-clients.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/
 etc/mysql/mariadb.conf.d/server.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/
-lib/systemd/system/mariadb-extra.socket # Installed by rules file
-lib/systemd/system/mariadb-extra at .socket # Installed by rules file
-lib/systemd/system/mariadb.service # Installed by rules file
-lib/systemd/system/mariadb at .service # Installed by rules file
-lib/systemd/system/mariadb.socket # Installed by rules file
-lib/systemd/system/mariadb at .socket # Installed by rules file
+usr/lib/systemd/system/mariadb-extra.socket # Installed by rules file
+usr/lib/systemd/system/mariadb-extra at .socket # Installed by rules file
+usr/lib/systemd/system/mariadb.service # Installed by rules file
+usr/lib/systemd/system/mariadb at .service # Installed by rules file
+usr/lib/systemd/system/mariadb.socket # Installed by rules file
+usr/lib/systemd/system/mariadb at .socket # Installed by rules file
 usr/bin/mariadb-embedded # Shipping the embedded server in distro packaging does not make sense
 usr/bin/mysql_config # Debian packaging has mysql_config as symlink to mariadb_config
 usr/bin/mysql_embedded # Symlink to mariadb-embedded which is intentionally not included
diff -Nru mariadb-10.11.6/debian/patches/install-files-into-usr.patch mariadb-10.11.6/debian/patches/install-files-into-usr.patch
--- mariadb-10.11.6/debian/patches/install-files-into-usr.patch	1970-01-01 01:00:00.000000000 +0100
+++ mariadb-10.11.6/debian/patches/install-files-into-usr.patch	2024-01-22 22:30:08.000000000 +0100
@@ -0,0 +1,31 @@
+From cca521fa52f5d78083b06a6cd232efadb72d8eae Mon Sep 17 00:00:00 2001
+From: Michael Biebl <biebl at debian.org>
+Date: Mon, 22 Jan 2024 22:52:25 +0100
+Subject: [PATCH] Install PAM modules and systemd units into /usr
+
+Since Debian trixie all files need to be installed into their canonical
+location under /usr.
+---
+ cmake/install_layout.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
+index 877b147bc6e..29fbbccddca 100644
+--- a/cmake/install_layout.cmake
++++ b/cmake/install_layout.cmake
+@@ -194,10 +194,10 @@ SET(INSTALL_SUPPORTFILESDIR_DEB         "share/mysql")
+ SET(INSTALL_MYSQLDATADIR_DEB            "/var/lib/mysql")
+ 
+ SET(INSTALL_UNIX_ADDRDIR_DEB            "/run/mysqld/mysqld.sock")
+-SET(INSTALL_SYSTEMD_UNITDIR_DEB         "/lib/systemd/system")
++SET(INSTALL_SYSTEMD_UNITDIR_DEB         "/usr/lib/systemd/system")
+ SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB     "/usr/lib/sysusers.d")
+ SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB     "/usr/lib/tmpfiles.d")
+-SET(INSTALL_PAMDIR_DEB                  "/lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}/security")
++SET(INSTALL_PAMDIR_DEB                  "/usr/lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}/security")
+ SET(INSTALL_PAMDATADIR_DEB              "/etc/security")
+ 
+ #
+-- 
+2.43.0
+
diff -Nru mariadb-10.11.6/debian/patches/series mariadb-10.11.6/debian/patches/series
--- mariadb-10.11.6/debian/patches/series	2024-01-05 09:32:12.000000000 +0100
+++ mariadb-10.11.6/debian/patches/series	2024-01-22 22:30:08.000000000 +0100
@@ -11,3 +11,4 @@
 2777-fix-disks-disk-test.patch
 2883-subselect-test-failures.patch
 2980-riscv-use-rdtime.patch
+install-files-into-usr.patch


More information about the pkg-mysql-maint mailing list