Timeline for Filter out and kill non-docker processes
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 27, 2017 at 23:30 | vote | accept | tepsijash | ||
| Jul 27, 2017 at 6:22 | answer | added | cas | timeline score: 1 | |
| Jul 27, 2017 at 5:54 | comment | added | cas | pkill has --ns pid and --nslist name... options which you can use to limit the slaughter to a specific namespace. e.g. using pkill with --ns $$ from sh/bash/etc should kill only matching processes in the same namespace as your shell (all your docker containers will be in different namespaces). | |
| Jul 26, 2017 at 12:41 | comment | added | tepsijash | They are the same \python───5*[{python}]. Also, I don't get the same results when I do ps aux and pkill. When I do pkill 'process_name' nothing happens actually, only when I do pkill python, but I don't want to kill all the python processes. EDIT: pkill -f works. Sorry for so many edits! | |
| Jul 26, 2017 at 12:33 | comment | added | terdon♦ | As you can see, they look identical so this won't be possible with ps aux. You will need to use the parent PID, probably. Could you show us the output of pstree $pid where $pid is the PID of each of the two (host and container) python processes? | |
| Jul 26, 2017 at 12:31 | history | edited | terdon♦ | CC BY-SA 3.0 | deleted 8 characters in body |
| Jul 26, 2017 at 12:31 | comment | added | tepsijash | @terdon Thanks! I have added the examples now. | |
| Jul 26, 2017 at 12:29 | history | edited | tepsijash | CC BY-SA 3.0 | Added examples of ps aux output. |
| Jul 26, 2017 at 12:14 | comment | added | terdon♦ | Please edit your question and include an example of the relevant lines from the output of ps aux. Show at least one you would want to kill and one you would want to keep. Also, as a general rule, you don't use ps | grep for this sort of thing. That's what pkill is for. | |
| Jul 26, 2017 at 12:04 | history | asked | tepsijash | CC BY-SA 3.0 |