Skip to content

Commit d5daf12

Browse files
committed
Runtime: do not send kill to init
1 parent ae60caa commit d5daf12

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pylon/core/tools/signal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def signal_sigterm(signal_num, stack_frame):
3434
raise SystemExit
3535

3636

37-
def kill_remaining_processes():
37+
def kill_remaining_processes(context):
3838
""" Send SIGKILL to all other processes """
3939
try:
4040
current_pid = os.getpid()
@@ -44,7 +44,10 @@ def kill_remaining_processes():
4444
#
4545
for pid in running_pids:
4646
if pid == current_pid:
47-
continue
47+
continue # Skip pylon itself
48+
#
49+
if pid == 1 and context.runtime_init == "dumb-init":
50+
continue # Skip init
4851
#
4952
log.info("Killing remaining process: %s", pid)
5053
#

pylon/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def main(): # pylint: disable=R0912,R0914,R0915
199199
# Kill remaining processes to avoid keeping the container running on update
200200
if context.settings.get("system", {}).get("kill_remaining_processes", True) and \
201201
context.runtime_init in ["pylon", "dumb-init"]:
202-
kill_remaining_processes()
202+
kill_remaining_processes(context)
203203
# Exit
204204
log.info("Exiting")
205205

0 commit comments

Comments
 (0)