MDEV-14296: Relocate wsrep_sst_common from /usr/bin to /usr/share/mariadb#4871
MDEV-14296: Relocate wsrep_sst_common from /usr/bin to /usr/share/mariadb#4871FaramosCZ wants to merge 1 commit intoMariaDB:mainfrom
Conversation
2a91016 to
3c584a0
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution. This is a preliminary review.
LGTM.
Please stand by for the final review.
grooverdan
left a comment
There was a problem hiding this comment.
Ok. aside from the selinux question I'm ok with this.
Minor but resolvable conflict with #4644.
This PR highlight I may have made a mistake on the script components. Very timely. I'll leave as mergable as posisble.
…iadb wsrep_sst_common is a bash function library (no shebang, only function definitions and shared variables) that is sourced by other wsrep_sst_* scripts. Unlike those scripts, it is not an executable and should not reside in /usr/bin. This commit moves it to the shared data directory (INSTALL_MYSQLSHAREDIR, typically /usr/share/mariadb on RPM/DEB systems), which is the standard location for architecture-independent data files. Prior attempts (PR MariaDB#603, PR MariaDB#2706) used a new INSTALL_LIBEXECDIR CMake variable to move wsrep_sst_common to /usr/libexec. Both PRs were closed without merge. The libexecdir approach had two problems: 1. The CMakeLists.txt change was too broad — it redirected all wsrep scripts to libexecdir, not just wsrep_sst_common. The other wsrep_sst_* scripts are user-facing executables and belong in /usr/bin. LinuxJedi identified this on PR MariaDB#2706: "user executable binaries such as mytop are going into libexec and some binaries that should be libexec going to bin." 2. FHS semantics: /usr/libexec is for executable helper programs not meant to be run directly by users. wsrep_sst_common is not executable at all — it is a sourced shell function library. /usr/share/<package> is the standard FHS location for architecture-independent data files, which is what a shell function library is. grooverdan confirmed on PR MariaDB#3335: "its sourced, its never directly executed." This commit avoids the scope problem by reusing the existing INSTALL_MYSQLSHAREDIR variable and only changing the destination for wsrep_sst_common specifically, not all scripts. New install path: ${INSTALL_MYSQLSHAREDIR}/wsrep_sst_common - RPM layout: /usr/share/mariadb/wsrep_sst_common - DEB layout: /usr/share/mariadb/wsrep_sst_common - Standalone layout: <prefix>/share/wsrep_sst_common Files modified: scripts/CMakeLists.txt - Changed INSTALL(FILES ...) destination from ${INSTALL_BINDIR} to ${INSTALL_MYSQLSHAREDIR} for wsrep_sst_common. scripts/wsrep_sst_backup.sh scripts/wsrep_sst_mariabackup.sh scripts/wsrep_sst_mysqldump.sh scripts/wsrep_sst_rsync.sh - Updated the source command to locate wsrep_sst_common. The new logic first checks the script's own directory (for build-tree / MTR test compatibility), and falls back to the CMake-substituted installed path (@INSTALL_MYSQLSHAREDIRABS@) when the file is not found alongside the calling script. support-files/policy/apparmor/usr.sbin.mysqld - Updated AppArmor read permission from /usr/bin/wsrep_sst_common to /usr/share/mariadb/wsrep_sst_common. debian/mariadb-server.install - Updated Debian package file list entry from usr/bin/wsrep_sst_common to usr/share/mariadb/wsrep_sst_common. Co-Authored-By: Claude AI <noreply@anthropic.com>
|
Sorry for being rightfully suspicious about mysql-selinux needing an update. While I looked at this I notice I did some thing wrong hence #4923. With the version bumped mysql-selinux + #4923 this would become a dependency in If its possible to get into Fedora/RHEL/Centos by 2026-05-08, the planned 12.3.2 release date we could make this a bug fix against 12.3. If a user was really desperate is a dnf localinstall of the Fedora mysql-selinux package on RHEL an actual solution? (though a local copy of the common file back to /usr/bin may be cleaner). So up to you:
|
AFAIK yes.
That's OK for Fedora but not by far for RHEL. -- In Fedora it just landed to Rawhide. |
wsrep_sst_common is a bash function library (no shebang, only function definitions and shared variables) that is sourced by other wsrep_sst_* scripts. Unlike those scripts, it is not an executable and should not reside in /usr/bin. This commit moves it to the shared data directory (INSTALL_MYSQLSHAREDIR, typically /usr/share/mariadb on RPM/DEB systems), which is the standard location for architecture-independent data files.
New install path: ${INSTALL_MYSQLSHAREDIR}/wsrep_sst_common
Files modified:
scripts/CMakeLists.txt
- Changed INSTALL(FILES ...) destination from ${INSTALL_BINDIR} to ${INSTALL_MYSQLSHAREDIR} for the WSREP_SOURCE (wsrep_sst_common).
- Updated comment to explain the rationale for the non-bindir location.
scripts/wsrep_sst_backup.sh
scripts/wsrep_sst_mariabackup.sh
scripts/wsrep_sst_mysqldump.sh
scripts/wsrep_sst_rsync.sh
- Updated the source command to locate wsrep_sst_common. The new logic first checks the script's own directory (for build-tree / MTR test compatibility, where all scripts are generated into the same build directory), and falls back to the CMake-substituted installed path (@INSTALL_MYSQLSHAREDIRABS@) when the file is not found alongside the calling script.
support-files/policy/apparmor/usr.sbin.mysqld
- Updated AppArmor read permission from /usr/bin/wsrep_sst_common to /usr/share/mariadb/wsrep_sst_common.
debian/mariadb-server.install
- Updated Debian package file list entry from usr/bin/wsrep_sst_common to usr/share/mariadb/wsrep_sst_common.