summaryrefslogtreecommitdiffstats
path: root/core/modules/ntfsfree
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-11 10:38:56 +0200
committerSimon Rettberg2022-05-11 10:38:56 +0200
commit6b1653f589133a9f867b5f31c7b7a2e245b12ee5 (patch)
tree5f8da134b7a73dda2f186600532e7df62ced5bc4 /core/modules/ntfsfree
parent[dhcpc-busybox] DHCP: Take iface up (diff)
downloadmltk-6b1653f589133a9f867b5f31c7b7a2e245b12ee5.tar.gz
mltk-6b1653f589133a9f867b5f31c7b7a2e245b12ee5.tar.xz
mltk-6b1653f589133a9f867b5f31c7b7a2e245b12ee5.zip
[ntfsfree] Don't send debug report if we're shutting down
Diffstat (limited to 'core/modules/ntfsfree')
-rwxr-xr-xcore/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow b/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow
index 7ed678f7..3dfe5758 100755
--- a/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow
+++ b/core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow
@@ -1,6 +1,7 @@
#!/bin/bash
MODE=
+DO_EXIT=
case "$1" in
--*)
MODE="${1:2}"
@@ -31,6 +32,7 @@ if [ "$MODE" = "wait" ]; then
}
debug_submit() {
+ [ -n "$DO_EXIT" ] && return
[ -s "$DEBUG_FILE" ] || return
slxlog --sync "id44-grow" "ID44 remaining space monitoring" "$DEBUG_FILE"
debug_reset
@@ -114,11 +116,17 @@ unlock() {
fi
}
+term_hook() {
+ DO_EXIT=1
+ exit 1
+}
+
exit_hook() {
debug_submit
[ -n "$HAVE_LOCK" ] && unlock
}
+trap term_hook TERM INT
trap exit_hook EXIT
# Try to grow via NTFS volume
@@ -314,7 +322,7 @@ elif [ "$MODE" = "wait" ]; then
# Listen for dm events which might signal low_watermark hits,
# grow if necessary
next=
- while true; do
+ while [ -z "$DO_EXIT" ]; do
if lock; then
if is_space_running_out; then
if do_resize; then