Locking PID file inside daemon