我试图发送信号到django开发服务器杀死父和子进程。适当的信号杀django开发服务器
$ python manage.py runserver
Validating models...
0 errors found
Django version 1.4.1, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
$ ps axf
26077 pts/12 Ss 0:00 \_ -bash
4189 pts/12 S+ 0:00 | \_ python manage.py runserver
4194 pts/12 Sl+ 0:00 | \_ /myproject/.virtualenv/bin/python manage.py runserver
$ kill -s SIGINT 4189
$ ps axf
4194 pts/12 Sl 0:00 /sh/myproject/.virtualenv/bin/python manage.py runserver
我的理解是,SIGINT应该效仿按Ctrl-C终端,但是请注意SIGINT终止父,4189,但没有孩子,4194.为SIGKILL,SIGTERM,SIGSTOP相同的行为。按预期方式使用终端中的Ctrl-C。
有没有办法在不知道孩子PID的情况下杀死孩子的方式来终止父母?
“有没有办法终止父母在一个这样也会杀死孩子吗?“ 我希望通过杀死父母来间接杀死孩子。我试图运行使用runit套件监督的django dev服务器,而不使用--noreload。 – Aaron
@Aaron,这个答案适用于我,但接受的答案没有 – Gab