Open tbroyer opened 7 years ago
Is there any update to this? I have lots of FireFox child processes running in the background and not killed because of this issue. Any fix suggestions would be great
I start slimerjs from python script and i met the same problem. I found interesting solution at https://stackoverflow.com/questions/39420683/killing-a-sub-subprocess-from-python-bash-without-leaving-orphans
# python3
import os
import signal
# start process
process = subprocess.Popen(slimer_command ..., preexec_fn=os.setpgrp)
pid = process.pid
# kill process
os.killpg(os.getpgid(pid), signal.SIGTERM)
Description of os functions: https://docs.python.org/3/library/os.html. I am sure there is enough info to implement the same in bash script.
The idea is that you perform setpgrp
before starting slimerjs and then kill its process group.
versions
Steps to reproduce the issue
kill $!
, otherwisekillall slimerjs
should do it.ps aux |grep slimer
Actual results:
The Firefox child process has been orphaned. It is listed by
ps
and will print its output to the console upon termination.Expected results:
The Firefox child process is killed.