|
@@ -192,9 +192,6 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append
|
|
global worker_pipe_lock
|
|
global worker_pipe_lock
|
|
pipein.close()
|
|
pipein.close()
|
|
|
|
|
|
- signal.signal(signal.SIGTERM, sigterm_handler)
|
|
|
|
- # Let SIGHUP exit as SIGTERM
|
|
|
|
- signal.signal(signal.SIGHUP, sigterm_handler)
|
|
|
|
bb.utils.signal_on_parent_exit("SIGTERM")
|
|
bb.utils.signal_on_parent_exit("SIGTERM")
|
|
|
|
|
|
# Save out the PID so that the event can include it the
|
|
# Save out the PID so that the event can include it the
|
|
@@ -209,6 +206,11 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, append
|
|
# This ensures signals sent to the controlling terminal like Ctrl+C
|
|
# This ensures signals sent to the controlling terminal like Ctrl+C
|
|
# don't stop the child processes.
|
|
# don't stop the child processes.
|
|
os.setsid()
|
|
os.setsid()
|
|
|
|
+
|
|
|
|
+ signal.signal(signal.SIGTERM, sigterm_handler)
|
|
|
|
+ # Let SIGHUP exit as SIGTERM
|
|
|
|
+ signal.signal(signal.SIGHUP, sigterm_handler)
|
|
|
|
+
|
|
# No stdin
|
|
# No stdin
|
|
newsi = os.open(os.devnull, os.O_RDWR)
|
|
newsi = os.open(os.devnull, os.O_RDWR)
|
|
os.dup2(newsi, sys.stdin.fileno())
|
|
os.dup2(newsi, sys.stdin.fileno())
|