Added -graceful-kill flag to support graceful termination of the child process