Timeline for How do I kill all processes except PID 1?
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 17, 2016 at 18:57 | history | edited | DopeGhoti | CC BY-SA 3.0 | added 2 characters in body |
| May 17, 2016 at 10:34 | comment | added | Stéphane Chazelas | There are many implementations of init on Linux, whether they ignore SIGTERM will vary with implementations. From a grep SigIgn /proc/1/status on my system using systemd, SIGPIPE is the only signal that it ignores. It doesn't matter anyway, as for processes of pid 1 on Linux, signals are ignored if they are not otherwise handled by the application. | |
| May 17, 2016 at 10:22 | comment | added | Stéphane Chazelas | @theblazehen, at least with the killall from psmisc on Linux, killall '*' returns with a *: no process found message as arguments are not meant to be patterns. With that version of killall however, you can use -r for the argument to be taken as a regexp, so it behaves more like pkill (the companion command of pgrep used by the OP). So killall -r '^' or pkill '^'. SIGTERM is the default signal, you don't need -TERM. | |
| May 17, 2016 at 7:29 | comment | added | theblazehen | F21: That's because shell expansion happens. Try doing killall -TERM '*' | |
| May 17, 2016 at 6:48 | comment | added | F21 | Running killall -TERM * doesn't kill anything for me: killall: bin: no process killed killall: src: no process killed. ps confirms that no process was killed. | |
| May 17, 2016 at 6:22 | history | answered | DopeGhoti | CC BY-SA 3.0 |