Skip to main content

Timeline for answer to How to check if a process id (PID) exists by unwind

Current License: CC BY-SA 2.5

Post Revisions

4 events
when toggle format what by license comment
Jun 15, 2010 at 11:08 comment added Christoffer Hammarström Don't carelessly kill -9. That just instantly kills the process giving it no chance to clean up after itself. Instead use kill which is equivalent to kill -15. If that doesn't work, you should find out why, and only as a last resort use kill -9.
Jun 15, 2010 at 9:51 comment added Richard H at the moment I am just doing kill -9 with no check - i just get an error "process doesn't exist" if it doesn't exist which isn't very tidy. How would I test what happened?
Jun 15, 2010 at 9:47 comment added just somebody +1 unfortunately kill(1)'s exit code doesn't distinguish the different error situations (looks like it increments the exit value by one for each process it failed to signal). if the OP doesn't mind writing their own kill(2) wrapper, he could have it exit with different values based on the value of ERRNO after a failed kill(2) call.
Jun 15, 2010 at 9:32 history answered unwind CC BY-SA 2.5