Unify daemon logic
Some comments for the PID file logic