summaryrefslogtreecommitdiffstats
path: root/satellit_installer
diff options
context:
space:
mode:
authorSimon Rettberg2022-06-01 15:18:23 +0200
committerSimon Rettberg2022-06-01 15:18:23 +0200
commite6a3c4787a76020dbba5b0317f527edd4c3f703b (patch)
treef06e3e824f823a427645f2bbcd72610fc003cc56 /satellit_installer
parent[SSUS] Use --force not --update to downgrade server (diff)
downloadsetup-scripts-e6a3c4787a76020dbba5b0317f527edd4c3f703b.tar.gz
setup-scripts-e6a3c4787a76020dbba5b0317f527edd4c3f703b.tar.xz
setup-scripts-e6a3c4787a76020dbba5b0317f527edd4c3f703b.zip
[SSPS] Make dnbd3-stage4-cleanup run as user dnbd3
Diffstat (limited to 'satellit_installer')
-rwxr-xr-xsatellit_installer/static_files/dnbd3/etc/cron.daily/dnbd3-stage4-cleanup5
1 files changed, 5 insertions, 0 deletions
diff --git a/satellit_installer/static_files/dnbd3/etc/cron.daily/dnbd3-stage4-cleanup b/satellit_installer/static_files/dnbd3/etc/cron.daily/dnbd3-stage4-cleanup
index 7a43f0a..690b05b 100755
--- a/satellit_installer/static_files/dnbd3/etc/cron.daily/dnbd3-stage4-cleanup
+++ b/satellit_installer/static_files/dnbd3/etc/cron.daily/dnbd3-stage4-cleanup
@@ -1,5 +1,10 @@
#!/bin/bash
+if [ "$UID" = 0 ]; then
+ # Force we're running as dnbd3, as cron invokes us as root
+ exec sudo -u dnbd3 -n "${BASH_SOURCE[0]}"
+fi
+
# Find all .meta files in stage 4 directory
mapfile -d '' list < <( find /srv/openslx/nfs/stage4/bwlp/ -type f -name "*.meta" -print0 )