[Buildroot] [PATCH v5 11/11] autobuild-run: catch KeyboardInterrupt in the same way as SIGTERM

Thomas De Schampheleire patrickdepinguin at gmail.com
Fri Dec 12 20:04:56 UTC 2014


From: Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>

Do not handle a keyboard interrupt (SIGINT) in any different way than a
SIGTERM signal (kill). In both cases, the entire process tree of the
autobuild-run process should be killed.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
---
 scripts/autobuild-run | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 3c448bd..c8ce918 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -701,6 +701,7 @@ def main():
         """Kill all children"""
 
         # uninstall signal handler to prevent being called for all subprocesses
+        signal.signal(signal.SIGINT, signal.SIG_IGN)
         signal.signal(signal.SIGTERM, signal.SIG_DFL)
 
         # stop all instances to prevent new children to be spawned
@@ -740,6 +741,7 @@ def main():
         p.start()
         processes.append(p)
 
+    signal.signal(signal.SIGINT, sigterm_handler)
     signal.signal(signal.SIGTERM, sigterm_handler)
 
     for p in processes:
-- 
1.8.5.1



More information about the buildroot mailing list