Funny that both you and BrowserUK decide to kill using SIGKILL. That's not very friendly, and not "the appropriate way" - it doesn't give the program a chance to shutdown gracefully (for instance, if the killed process would be a Perl program, sending it SIGKILL robs the program of its opportunity to run END blocks. Or to call DESTROY. Or to cleanly shut down database connections.). Send it a SIGTERM (often 15, but technically, it's architecture dependent - check
if you want to cover portability issues).