diff options
author | Simon Rettberg | 2022-05-11 10:38:56 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-05-11 10:38:56 +0200 |
commit | 6b1653f589133a9f867b5f31c7b7a2e245b12ee5 (patch) | |
tree | 5f8da134b7a73dda2f186600532e7df62ced5bc4 /core/modules/ntfsfree | |
parent | [dhcpc-busybox] DHCP: Take iface up (diff) | |
download | mltk-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-x | core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow | 10 |
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 |