Added support for PID files in CLI applications