summaryrefslogtreecommitdiffstats
path: root/core/modules/dnbd3-proxy-mode
diff options
context:
space:
mode:
authorSimon Rettberg2022-10-04 11:01:44 +0200
committerSimon Rettberg2022-10-04 11:01:44 +0200
commit7b37b0625d6dbb38c35ca723cbc2e3b75ee17743 (patch)
treec2632c083869fc10f3f50819d27f1f7a1f5cdce2 /core/modules/dnbd3-proxy-mode
parent[idleaction] Add comments (diff)
downloadmltk-7b37b0625d6dbb38c35ca723cbc2e3b75ee17743.tar.gz
mltk-7b37b0625d6dbb38c35ca723cbc2e3b75ee17743.tar.xz
mltk-7b37b0625d6dbb38c35ca723cbc2e3b75ee17743.zip
[dnbd3-proxy-mode] Avoid double-reboots
Diffstat (limited to 'core/modules/dnbd3-proxy-mode')
-rwxr-xr-xcore/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy
index 1ad64c7f..ce6b9878 100755
--- a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy
+++ b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy
@@ -214,16 +214,17 @@ else
else
W="0"
fi
+ # Uptime >10hrs, or we might reboot multiple times if $H is > last $H
cat > "/etc/cron.d/dnbd3-reboot" <<EOF
# OpenSLX: Reboot proxy at night
SHELL=/bin/ash
PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin
-$M $H * * $W root reboot
+$M $H * * $W root [ "\$(grep -oEm1 '^[0-9]+' /proc/uptime) -lt 36000 ] || reboot
EOF
#
-fi
+fi # end local caching or proxy mode
rm -f "${DNBD3_CONF_DIR}/server.conf"
# Refer to http://git.openslx.org/dnbd3.git/tree/conf for configuration options