From 6b1653f589133a9f867b5f31c7b7a2e245b12ee5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 11 May 2022 10:38:56 +0200 Subject: [ntfsfree] Don't send debug report if we're shutting down --- core/modules/ntfsfree/data/opt/openslx/scripts/thinpool-grow | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'core/modules/ntfsfree') 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 -- cgit v1.2.3-55-g7522