From ff2910a7461dcc386afa5c011f374f9b78037d9b Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sat, 8 Jan 2022 08:31:50 +0100 Subject: [PATCH] send SIGHUP to children if tar failed --- mmdebstrap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index 72849a8..eeee653 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -5763,7 +5763,12 @@ sub main() { if ($@) { # we cannot die here because that would leave the other thread # running without a parent + # We send SIGHUP to all our processes (including eventually + # running tar and this process itself) to reliably tear down + # all running child processes. The main process is not affected + # because we are ignoring SIGHUP. warning "creating tarball failed: $@"; + kill HUP => -getpgrp(); $exitstatus = 1; } } else {