summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorTuukka Pasanen <tuukka.pasanen@ilmi.fi>2021-11-16 12:53:51 +0200
committerDaniel Black <daniel@mariadb.org>2022-01-07 17:51:20 +1100
commit25f598f54feb71d0752e851147495f2fabf12b7b (patch)
tree3c712a8756e8a8337973dffe6179714d66e387fe /support-files
parent80da35a3267724804c6ced03a27e00d9551b3e01 (diff)
downloadmariadb-git-25f598f54feb71d0752e851147495f2fabf12b7b.tar.gz
MDEV-26317: Add SYSTEMD_READWRITEPATH variable to mariadb.service.in-file
Add SYSTEMD_READWRITEPATH-variable to mariadb{@,}.service.in to make sure that if one is not building RPM or DEB packages then make sure there is ReadWritePaths directive is defined in systemd service file. This ensures that tar-ball installation has permissions to write database default installation path (default: /usr/local/mysql/data) even if it's located under /usr. Writing to that location is prevented by 'ProtectSystem=full' systemd directive by default. Prefixing the path with "-" in systemd causes there to not be an error if the path doesn't exist. This may occur if the user has configured a datadir elsewhere. Reviewer: Daniel Black
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mariadb.service.in2
-rw-r--r--support-files/mariadb@.service.in2
2 files changed, 4 insertions, 0 deletions
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
index fa445250a10..8b50e42ec94 100644
--- a/support-files/mariadb.service.in
+++ b/support-files/mariadb.service.in
@@ -55,6 +55,8 @@ CapabilityBoundingSet=CAP_IPC_LOCK
# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full
+@SYSTEMD_READWRITEPATH@
+
# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=true
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index 3f1765f4572..c14b7d2e611 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -63,6 +63,8 @@ CapabilityBoundingSet=CAP_IPC_LOCK
# Prevent writes to /usr, /boot, and /etc
ProtectSystem=full
+@SYSTEMD_READWRITEPATH@
+
# Doesn't yet work properly with SELinux enabled
# NoNewPrivileges=true