The PIDFile(...) call creates the pid file while it's running. It cleans up after itself when the server stops.