Skip to content

Install PAM modules and systemd units from /lib to /usr/lib #4065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 11.8
Choose a base branch
from

Conversation

ottok
Copy link
Contributor

@ottok ottok commented May 25, 2025

Description

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 part in MariaDB to fully complete the usr merge migration. Stable releases should not move files around, so target MariaDB 11.8 as the first release to have the /usr merge fully completed.

References:

Release Notes

  • Install PAM modules and systemd units from are now installed to /usr/lib instead of /lib

How can this PR be tested?

CI should continue to be green for builds, installs and upgrades.

Basing the PR against the correct MariaDB version

  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

@svoj svoj added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label May 25, 2025
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
part in MariaDB to fully complete the usr merge migration. Stable releases
should not move files around, so target MariaDB 11.8 as the first release
to have the /usr merge fully completed.

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/
@ottok ottok force-pushed the 11.8-usr-merge branch from 943546a to 9c3bcc1 Compare May 25, 2025 08:18
@ottok
Copy link
Contributor Author

ottok commented May 25, 2025

Job buildbot/amd64-debian-11-debug-ps-embedded failed on test unrelated to changes in this PR:

main.vector2                             w8 [ fail ]
        Test ended at 2025-05-25 08:30:34
CURRENT_TEST: main.vector2
Warning: /home/buildbot/amd64-debian-11-debug-ps-embedded/build/libmysqld/examples/mariadb-test-embedded: unknown option '--loose-disable-ssl-verify-server-cert'
Warning: /home/buildbot/amd64-debian-11-debug-ps-embedded/build/libmysqld/examples/mariadb-test-embedded: unknown variable 'loose-ssl-ca=/home/buildbot/amd64-debian-11-debug-ps-embedded/build/mysql-test/std_data/cacert.pem'
Warning: /home/buildbot/amd64-debian-11-debug-ps-embedded/build/libmysqld/examples/mariadb-test-embedded: unknown variable 'loose-ssl-cert=/home/buildbot/amd64-debian-11-debug-ps-embedded/build/mysql-test/std_data/client-cert.pem'
Warning: /home/buildbot/amd64-debian-11-debug-ps-embedded/build/libmysqld/examples/mariadb-test-embedded: unknown variable 'loose-ssl-key=/home/buildbot/amd64-debian-11-debug-ps-embedded/build/mysql-test/std_data/client-key.pem'
Warning: /home/buildbot/amd64-debian-11-debug-ps-embedded/build/libmysqld/examples/mariadb-test-embedded: unknown option '--loose-skip-ssl'
--- /home/buildbot/amd64-debian-11-debug-ps-embedded/build/mysql-test/main/vector2.result	2025-05-25 08:22:14.000000000 +0000
+++ /home/buildbot/amd64-debian-11-debug-ps-embedded/build/mysql-test/main/vector2.reject	2025-05-25 08:30:34.044000000 +0000
@@ -339,7 +339,6 @@
 15	[33]
 2	[33]
 28	[28]
-29	[29]
 3	[33]
 30	[30]
 31	[31]
@@ -349,6 +348,7 @@
 35	[35]
 36	[36]
 37	[37]
+38	[38]
 4	[33]
 5	[33]
 6	[33]
Result content mismatch

@ottok
Copy link
Contributor Author

ottok commented May 25, 2025

Job buildbot/amd64-ubuntu-2004-debug failed on test unrelated to changes in this PR:

rpl.rpl_gtid_startpos 'stmt'             w15 [ fail ]
        Test ended at 2025-05-25 08:35:24
CURRENT_TEST: rpl.rpl_gtid_startpos
mysqltest: In included file "./include/wait_for_purge.inc": 
included from /home/buildbot/amd64-ubuntu-2004-debug/build/mysql-test/suite/rpl/t/rpl_gtid_startpos.test at line 233:
At line 53: ERROR: failed while waiting for binlog purge to master-bin.000004

Copy link
Member

@grooverdan grooverdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

After validating SLES/OpenSUSE and RHEL this can continue on the RPM side (noting the Fedora change https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin).

This has almost certainly missed the 11.8 stable GA release.

Given the symlinking that has been in place for a long time and services that reference these non-user files don't do so by full path maybe there isn't a concern in changing the install location?

@ottok
Copy link
Contributor Author

ottok commented May 26, 2025

OpenSUSE implemented the /usr merge in 2021: https://en.opensuse.org/openSUSE:Usr_merge

I don't have access to a SUSE system to check, but pretty sure if has it already.

Fedora did the change in 2012 and presumably RHEL 7 in 2014 had it (10+ years ago).

@grooverdan
Copy link
Member

ack.

Interesting not visible in the BCI which I thought was SLES based:

$ podman run -ti  registry.suse.com/bci/bci-base:15.7
Trying to pull registry.suse.com/bci/bci-base:15.7...
Getting image source signatures
Copying blob 974449b21a84 done   | 
Copying config 4652df9563 done   | 
Writing manifest to image destination
73bfceae7edc:/ # ls -lad  /bin /sbin /lib*
drwxr-xr-x. 2 root root 4096 May  7 19:18 /bin
drwxr-xr-x. 5 root root 4096 May  7 19:18 /lib
drwxr-xr-x. 3 root root 4096 May  7 19:18 /lib64
drwxr-xr-x. 2 root root 4096 May  7 19:18 /sbin
73bfceae7edc:/ # ls -lad  /usr/bin /usr/sbin /usr/lib*
drwxr-xr-x.  2 root root 12288 May  7 19:18 /usr/bin
drwxr-xr-x. 25 root root  4096 May  7 19:18 /usr/lib
drwxr-xr-x. 10 root root 12288 May  7 19:18 /usr/lib64
drwxr-xr-x.  2 root root  4096 May  7 19:18 /usr/sbin
73bfceae7edc:/ # ls /bin | wc -l
52
73bfceae7edc:/ # ls usr/bin | wc -l
299
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.
Development

Successfully merging this pull request may close these issues.

3 participants