MDEV-37726 wsrep-new-cluster and wsrep-start-position in wrong directory with wrong selinux permissions #4316
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.
Description
After moving the systemd service to using environment files instead of
systemctl set-environment
in 11.6 (MDEV-19210), they (wsrep-new-cluster and wsrep-start-position) are located in /var/lib/mysql along with the socket file inFedora/RHEL-based distros. This causes them to have incorrect selinux permissions and therefore be not readable by systemd.
A solution is to generate these files in the run directory, instead, which already has correct selinux label mysqld_var_run_t mysql-selinux-1.0.12. Dissociating these files and the socket in CMake configs can also prove useful for other things.
This also corrects some of the duplicate code in the build scripts and made INSTALL_RUNDATADIR into a proper location and used this for the tmpfiles where the temporary files are created.
Moved Debian's location from the /run/mysqld/ (previously based on INSTALL_UNIX_ADDRDIR), to /run/mariadb as its a temporary location controlled by tmpfiles.
Release Notes
per JIRA entry
How can this PR be tested?
Run galera_new_cluster on Selinux enabled Fedora/RHEL.
Basing the PR against the correct MariaDB version
main
branch.PR quality check