summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2020-01-27 16:55:28 +0100
committerJonathan Bauer2020-01-27 16:55:28 +0100
commit44d6c86359e1b16273e0ee8734b142a11353cdc9 (patch)
tree6052bc6ae9e3b6d32cbcf8f8928f6461022f6f33
parent[SSUS] Explicitly exclude desired mariadb version from apt remove (diff)
downloadsetup-scripts-44d6c86359e1b16273e0ee8734b142a11353cdc9.tar.gz
setup-scripts-44d6c86359e1b16273e0ee8734b142a11353cdc9.tar.xz
setup-scripts-44d6c86359e1b16273e0ee8734b142a11353cdc9.zip
[SSUS] create /srv/openslx/nfs/stage4 on update
-rw-r--r--satellit_upgrader/updater.template.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index 594df66..433a4a3 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -181,6 +181,7 @@ declare -rg PATH_TFTP="/srv/openslx/tftp"
declare -rg PATH_IPXE="/opt/openslx/ipxe"
declare -rg PATH_LDADP="/opt/ldadp"
declare -rg PATH_DNBD3="/opt/openslx/dnbd3"
+declare -rg PATH_SLXSTORE="/srv/openslx/nfs"
# ** Check if constants have been filled, bail out otherwise
if [ -z "$TARGET_WEBIF_VERSION" ] || [[ "$TARGET_WEBIF_VERSION" == %*% ]]; then
@@ -706,6 +707,20 @@ if [ -n "$TGZ_DNBD3" ]; then
fi
fi
+# Make sure the dnbd3 user is able to write on the slx store (both internal and mounted ones).
+# If the slx store is currently unmounted, this has the slightly awkward side-effect of creating
+# the folder in the host's root filesystem. When the store will be mounted on PATH_SLXSTORE, the
+# taskmanager will make sure the stage4 folder is properly created on the share. We need to cope
+# with the use of internal store and since we cannot differentiate that case from an unmounted
+# network share, we simply always create it and check the group ownership & permissions.
+if [ ! -d "${PATH_SLXSTORE}/stage4" ]; then
+ if ! mkdir -p "${PATH_SLXSTORE}/stage4"; then
+ perror "Could not create 'stage4' directory in ${PATH_SLXSTORE}! Storage not writable!"
+ fi
+fi
+find "${PATH_SLXSTORE}/stage4" -type d -exec chgrp dnbd3 {} \; 2>/dev/null
+find "${PATH_SLXSTORE}/stage4" -type d -exec chmod ug+rwx {} \; 2>/dev/null
+
# ******************* dnbd3-server.service ***************
if diffcp "dnbd3/dnbd3-server.service" "/etc/systemd/system/dnbd3-server.service"; then
ln -n -s -f "../dnbd3-server.service" "/etc/systemd/system/multi-user.target.wants/dnbd3-server.service"