summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-19 11:30:15 +0100
committerSimon Rettberg2018-03-19 11:30:15 +0100
commitdd75235463a4e7ca2bc24d3219113456e6dab6f2 (patch)
tree8564b04c0113e0473e162cfca0b2d315e750ad10
parent[rfs-stage32] Include NVMe drivers (diff)
downloadmltk-dd75235463a4e7ca2bc24d3219113456e6dab6f2.tar.gz
mltk-dd75235463a4e7ca2bc24d3219113456e6dab6f2.tar.xz
mltk-dd75235463a4e7ca2bc24d3219113456e6dab6f2.zip
[hardware-stats] Suppress local warnings about swap/tmp if flag-file is present
-rwxr-xr-xcore/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-setup_dnbd3_proxy6
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update4
2 files changed, 10 insertions, 0 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 e1993f30..e19788bc 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
@@ -6,6 +6,9 @@ ERRLOG="/run/dnbd3-proxy.err"
[ -s "$ERRLOG" ] && exit 0 # already ran and failed, don't do it again
+# Log error to server and local file in /run.
+# The main startup script will check whether this file is > 0 bytes
+# and start in errormsg-mode.
errormsg () {
echo "$@" >> "$ERRLOG"
slxlog -s -e "dnbd3-setup" "$@"
@@ -40,6 +43,9 @@ else
|| ! [ "$(disksize "${DNBD3_BASE_DIR}")" -gt 12000 ]; then
# no sane fallback possible
errormsg "Neither a persistent part (ID45) nor /tmp (ID44) are available, or they are < 12GB"
+ else
+ # We're using /tmp, don't warn about low space
+ touch "/run/openslx/no-ram-warning"
fi
fi
# now try to create the actual folder used by the server
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
index bbcf8494..563f68b0 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/cron-system_usage_update
@@ -35,6 +35,10 @@ curl -s --data-urlencode "type=~runstate" --data-urlencode "uuid=$UUID" --data-u
--data-urlencode "swapfree=$SWAP_FREE" "$SLX_REMOTE_LOG" > /dev/null 2>&1
# Warn user if tmp or swap usage is high; system might crash soon
+
+# ..but not if flag to shut up is present
+[ -e "/run/openslx/no-ram-warning" ] && exit 0
+
WARN=
if [ "$SWAP_FREE" -gt 0 ] && [ "$SWAP_FREE" -lt 500000 ]; then # less than 500MB swap
WARN="$WARN