Working with Python and Linux System Processes
Overview
- process group
- has process group leader
- the process that creates the group and whose PID becomes the PGID of the group.
- one or more processes sharing the same process group identifier (PGID)
- has process group leader
- session
- collection of process groups
- has session leader, which is process that started the new session
Links
- https://groups.google.com/forum/#!topic/comp.unix.programmer/beJvmbyKBmM
- http://stackoverflow.com/questions/13593223/making-sure-a-python-script-with-subprocesses-dies-on-sigint
- http://stackoverflow.com/questions/4789837/how-to-terminate-a-python-subprocess-launched-with-shell-true
- http://unix.stackexchange.com/questions/82724/ps-switches-to-display-pid-ppid-pgid-and-sid-collectively
- https://linux.die.net/man/1/pstree
- https://en.wikipedia.org/wiki/Unix_signal#POSIX_signals
- https://nattster.wordpress.com/2013/06/05/catch-kill-signal-in-python/
- https://en.wikipedia.org/wiki/Process_group
- http://stackoverflow.com/questions/21406887/python-subprocess-changing-directory
- http://stackoverflow.com/questions/3503719/emulating-bash-source-in-python
- http://unix.stackexchange.com/questions/48994/how-to-run-a-program-in-a-clean-environment-in-bash
- http://superuser.com/questions/956179/how-does-condas-source-activate-foo-work
- https://docs.python.org/2/library/signal.html
- https://docs.python.org/2/library/subprocess.html#subprocess.Popen.returncode
- https://docs.python.org/2/library/os.html
Command Reference
# Views processes with more details
ps -A -o pid,sid,pgid,comm