MDEV-14296: Relocate wsrep_sst_common from /usr/bin to /usr/share/mariadb#4871
Open
FaramosCZ wants to merge 1 commit intoMariaDB:mainfrom
Open
MDEV-14296: Relocate wsrep_sst_common from /usr/bin to /usr/share/mariadb#4871FaramosCZ wants to merge 1 commit intoMariaDB:mainfrom
FaramosCZ wants to merge 1 commit intoMariaDB:mainfrom
Conversation
80b53f1 to
2a91016
Compare
…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>
gkodinov
approved these changes
Apr 1, 2026
Member
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.