summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--satellit_installer/includes/00-dirs.inc1
-rw-r--r--satellit_installer/includes/90-set_directory_permissions.inc10
-rw-r--r--satellit_installer/includes/90-set_links.inc13
-rwxr-xr-xsatellit_installer/satellit_installer3
-rw-r--r--satellit_upgrader/updater.template.sh13
5 files changed, 36 insertions, 4 deletions
diff --git a/satellit_installer/includes/00-dirs.inc b/satellit_installer/includes/00-dirs.inc
index 5ed3328..871cd8a 100644
--- a/satellit_installer/includes/00-dirs.inc
+++ b/satellit_installer/includes/00-dirs.inc
@@ -8,4 +8,5 @@ export LDADPDIR="/opt/ldadp/"
export TFTPDIR="/srv/openslx/tftp"
export WWWDIR="/srv/openslx/www"
export IPXEDIR="$OPENSLXDIR/ipxe"
+export SLXADMINCACHE="/var/cache/slx-admin"
readonly CONFIGDIR DMSDDIR TASKMANDIR OPENSLXDIR OPENSLXSRVDIR LDADPDIR SYNCDAEMONDIR TFTPDIR WWWDIR
diff --git a/satellit_installer/includes/90-set_directory_permissions.inc b/satellit_installer/includes/90-set_directory_permissions.inc
index 62c63c3..f40322b 100644
--- a/satellit_installer/includes/90-set_directory_permissions.inc
+++ b/satellit_installer/includes/90-set_directory_permissions.inc
@@ -48,7 +48,11 @@ set_directory_permissions() {
# Make sure we spare the binary
chown root:root "$LDADPDIR/ldadp" # ... not the binary.
- mkdir -p -m 755 /opt/openslx/proxy 2>/dev/null
- chmod 755 /opt/openslx/proxy 2>/dev/null # if already there
- chown www-data /opt/openslx/proxy 2>/dev/null
+ mkdir -p -m 755 "$OPENSLXDIR"/proxy 2>/dev/null
+ chmod 755 "$OPENSLXDIR"/proxy 2>/dev/null # if already there
+ chown www-data "$OPENSLXDIR"/proxy 2>/dev/null
+
+ mkdir -p -m 0755 "$SLXADMINCACHE"
+ chmod 0755 "$SLXADMINCACHE" # if already there
+ chown -R www-data:www-data "$SLXADMINCACHE"
}
diff --git a/satellit_installer/includes/90-set_links.inc b/satellit_installer/includes/90-set_links.inc
new file mode 100644
index 0000000..fc20ef8
--- /dev/null
+++ b/satellit_installer/includes/90-set_links.inc
@@ -0,0 +1,13 @@
+set_links() {
+
+if [ -f "${SLXADMINCACHE}/baseconfig-bwidm_settings.json" ]; then
+ echo -n "# ${SLXADMINCACHE}/baseconfig-bwidm_settings.json already there."
+ [ -h "${SLXADMINCACHE}/baseconfig-bwidm_settings.json" ] && \
+ echo " ... and is a symbolic link." || \
+ echo " ... but is NOT a symbolic link."
+else
+ ln -s "${WWWDIR}/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json" "${SLXADMINCACHE}/baseconfig-bwidm_settings.json"
+ echo "# ${SLXADMINCACHE}/baseconfig-bwidm_settings.json link set."
+fi
+
+}
diff --git a/satellit_installer/satellit_installer b/satellit_installer/satellit_installer
index e15aea6..f83f603 100755
--- a/satellit_installer/satellit_installer
+++ b/satellit_installer/satellit_installer
@@ -181,6 +181,9 @@ patch_slxadmin
# Check dir and file permissions:
set_directory_permissions
+# And set some symbolic links thereafter:
+set_links
+
tar -z -c -T /dev/null -f /opt/openslx/empty.tgz
# Mark vmstore as not mounted
diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh
index debfdec..ca9f89a 100644
--- a/satellit_upgrader/updater.template.sh
+++ b/satellit_upgrader/updater.template.sh
@@ -68,8 +68,10 @@ restart_service () {
}
# ** Recursively set permissions of given directory to 0755/0644 optionally setting owner/group
+# ** If directory is not there it will be mkdir'ed.
fixperms () {
[ -e "$1" ] || perror "normalize_perms: $1 does not exist"
+ [ -d "$1" ] || mkdir -p "$1"
chmod -R a-rw,u+rwX,go+rX "$1"
if [ -n "$2" ]; then
chown -R "$2" "$1" || pwarning "Could not change owner of $1 to $2"
@@ -88,6 +90,7 @@ declare -rg PAYLOAD_OFFSET="%PAYLOAD_OFFSET%"
# ** Constants - hardcoded or determined at runtime
declare -rg PATH_SLXADMIN="/srv/openslx/www/slx-admin"
+declare -rg PATH_SLXADMINCACHE="/var/cache/slx-admin"
declare -rg PATH_DOZMOD="/opt/dmsd"
declare -rg PATH_TASKMANAGER="/opt/taskmanager"
declare -rg PATH_TFTP="/srv/openslx/tftp"
@@ -227,9 +230,17 @@ if [ -n "$TGZ_SLXADMIN" ]; then
fi
ln -s -f "$PATH_TFTP" "/srv/openslx/www/tftp" || perror "Could not symlink $PATH_TFTP to /srv/openslx/www/tftp"
echo "Web interface upgrade complete"
+ fixperms "${PATH_SLXADMINCACHE}" www-data:www-data
+
+ if [ -h "${PATH_SLXADMINCACHE}/baseconfig-bwidm_settings.json" ]; then
+ pwarning "There is already a link or file /srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json. Please check manually, it should lead to /srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json"
+ else
+ ln -s /srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json "${PATH_SLXADMINCACHE}/baseconfig-bwidm_settings.json" || \
+ pwarning "Could not set link ${PATH_SLXADMINCACHE}/baseconfig-bwidm_settings.json to /srv/openslx/www/slx-admin/modules-available/baseconfig_bwidm/baseconfig/settings.json - do so manually"
+ fi
fi
-# ************************* Dozmod *************************
+#************************* Dozmod *************************
if [ -n "$TGZ_DOZMOD" ]; then
[ -e "$TMPDIR/$TGZ_DOZMOD" ] || perror "$TGZ_DOZMOD missing from payload."
echo "* Dozentenmodul"