Instances don't handle signals, causing them not to get cleaned up
properly when terminated by a signal.
This commit adds a signal handler to the inst module, making sure
instances are properly cleaned up when terminated by a signal.
return 1
}
+_inst_stop_self() {
+ if ! inst_stop "$BASHPID"; then
+ return 1
+ fi
+
+ return 0
+}
+
_inst_run() {
local cmd="$1"
local args=("${@:2}")
return 1
fi
+ trap _inst_stop_self INT HUP TERM EXIT QUIT
+
if ! "$cmd" "${args[@]}"; then
ret=1
else