|
|
10.3: Kill another user logged in under Fast User Switching
% sudo kill -9 1234 No! Bad admin! Never use the KILL signal to kill by default. This is process assassination, and should never be done. Process 1234 might be the parent for any number of child processes that will end up in limbo because the KILL signal does not give the parent a chance to inform any children. Additionally, the KILL signal prevents a process from cleaning up any temporary files and shared memory segments, or shutting down socket connections. Instead, use the TERM signal by default, and work up to a KILL if the process in question proves resilient.
10.3: Kill another user logged in under Fast User Switching
Never use the KILL signal to kill by default. [...] Instead, use the TERM signal by default, and work up to a KILL if the process in question proves resilient. Could you explain more about this, please? I am a command line newbie, and am unfamiliar with
10.3: Kill another user logged in under Fast User Switching
Yeah, you should NEVER use kill -9 unless you have to.. It's a last resort. the -9 flag forces the computer to kill the process without prejudice, and without cleaning up after itself. The TERM flag will attempt to close out any remainding resources that the process was using before trying to cleanly exit it.
10.3: Kill another user logged in under Fast User Switching
I can only confirm this, I have managed to create kernel panics and stuck sub-processes (requiring a restart) with kill -9.
10.3: Kill another user logged in under Fast User Switching
kill -15 `ps --sort -pid axo%p.%u | grep <USERNAME> | cut -d. -f1 -`
10.3: Kill another user logged in under Fast User Switching
kill -15 `ps --sort -pid axo%p.%u | grep <USERNAME> | cut -d. -f1 -`
10.3: Kill another user logged in under Fast User Switching
Using the TERM signal is no different to using the KILL signal if the application hasn't registered a special signal handler for the TERM signal to gracefully shutdown the process. Check out the sigaction manual page and you will see this is the case as the default action for TERM is "terminate the process", exactly the same as KILL. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|