diff options
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 |