Use RunLock while daemonizing which is based on flock to prevent race conditions.