From 15e6ba668941f88ed1fc47a8411224ef2a3143c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 24 May 2025 19:43:52 -0700 Subject: [PATCH] MDEV-37197 Deb: Install PAM modules and systemd units in /usr/lib (not /lib) Since Fedora 17 and about 2012, the directory /lib has been a symlink to /usr/lib. Debian started a similar migration in 2019. Nowadays all major Linux distributions have a merged /usr, and the canonical location for files should be /usr/lib instead of just /lib. The location of PAM modules and systemd files is the last remaining `*_DEB` variables should fully complete the usr merge migration. Additionally re-applied `debputy reformat --style=black` to get files sorted in a standardized order. References: - https://fedoraproject.org/wiki/Features/UsrMove - https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#a-merged-usr-is-now-required - https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ --- cmake/install_layout.cmake | 4 ++-- debian/mariadb-server.install | 16 ++++++++-------- debian/not-installed | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 55e960a3c1572..d52836a4f4a18 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -196,10 +196,10 @@ SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql") SET(INSTALL_RUNDATADIR_DEB "/run/mysqld") SET(INSTALL_UNIX_ADDRDIR_DEB "${INSTALL_RUNDATADIR_DEB}/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") # diff --git a/debian/mariadb-server.install b/debian/mariadb-server.install index e2563ca5b4519..a7e410a7d86f6 100644 --- a/debian/mariadb-server.install +++ b/debian/mariadb-server.install @@ -6,14 +6,6 @@ debian/additions/source_mariadb.py usr/share/apport/package-hooks etc/apparmor.d/usr.sbin.mariadbd etc/logrotate.d/mariadb etc/security/user_map.conf -lib/*/security/pam_user_map.so -lib/systemd/system/mariadb-extra@.socket -lib/systemd/system/mariadb.service -lib/systemd/system/mariadb@.service -lib/systemd/system/mariadb@.socket -lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf -lib/systemd/system/mysql.service -lib/systemd/system/mysqld.service support-files/rpm/enable_encryption.preset etc/mysql/mariadb.conf.d/99-enable-encryption.cnf.preset usr/bin/aria_chk usr/bin/aria_dump_log @@ -35,6 +27,7 @@ usr/bin/wsrep_sst_mariabackup usr/bin/wsrep_sst_mysqldump usr/bin/wsrep_sst_rsync usr/bin/wsrep_sst_rsync_wan +usr/lib/*/security/pam_user_map.so usr/lib/mysql/plugin/auth_ed25519.so usr/lib/mysql/plugin/auth_mysql_sha2.so usr/lib/mysql/plugin/auth_pam.so @@ -59,6 +52,13 @@ usr/lib/mysql/plugin/simple_password_check.so usr/lib/mysql/plugin/sql_errlog.so usr/lib/mysql/plugin/type_mysql_json.so usr/lib/mysql/plugin/wsrep_info.so +usr/lib/systemd/system/mariadb-extra@.socket +usr/lib/systemd/system/mariadb.service +usr/lib/systemd/system/mariadb@.service +usr/lib/systemd/system/mariadb@.socket +usr/lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf +usr/lib/systemd/system/mysql.service +usr/lib/systemd/system/mysqld.service usr/lib/tmpfiles.d/mariadb.conf usr/share/doc/mariadb-server/mariadbd.sym.gz usr/share/man/man1/aria_chk.1 diff --git a/debian/not-installed b/debian/not-installed index 8936d8e7d76c4..9f00b18739725 100644 --- a/debian/not-installed +++ b/debian/not-installed @@ -4,8 +4,8 @@ etc/mysql/mariadb.conf.d/client.cnf # Debian packaging uses files from debian/ad 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.socket # Installed by rules file +usr/lib/systemd/system/mariadb-extra.socket # Installed by rules file +usr/lib/systemd/system/mariadb.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