Static Public Member Functions
|static void||detach ()|
|Detaches from the parent environment. |
|static void||detach (PidFile &pid_file)|
|An overload which allows for a delayed write of the new process-id to a file. |
Deamonisation includes fork()ing, detaching from the controlling terminal, setting the process umask, etc. The windows implementation does nothing.
|void G::Daemon::detach||(||PidFile &||pid_file||)||
An overload which allows for a delayed write of the new process-id to a file.
A delayed write is useful for network daemons which open a listening port. A second instance of the process will fail on startup, and should not overwrite the pid file of the running server. In this situation PidFile::commit() should be called just before entering the event loop.
Throws PidFile::Error on error.