From 44d6c86359e1b16273e0ee8734b142a11353cdc9 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 27 Jan 2020 16:55:28 +0100 Subject: [SSUS] create /srv/openslx/nfs/stage4 on update --- satellit_upgrader/updater.template.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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" -- cgit v1.2.3-55-g7522