Change to add the PID of the main process to a file for restart in -g option