|
|
|
|
|
by jmclnx
82 days ago
|
|
Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9. Use one of these instead: -TERM then wait, if not
-INT then wait, if not
-HUP then wait, if not
-ABRT
If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead. |
|
It could also monitor the target process and inform you immediately when it exits, saving you the trouble of using "ps" to confirm that the target is actually gone.