|cxxtools::posix::CommandInput starts a process and the stdin is connected to the current process. More...|
|cxxtools::posix::CommandOutput starts a process and the stdout of the process can be read. More...|
|cxxtools::posix::Exec is a wrapper around the exec?? functions of posix. More...|
|A simple wrapper for the system function fork(2). More...|
|Simple unix pipe iostream. More...|
|void||daemonize (const std::string &pidfile=std::string())|
|This function makes a background daemon process out of the current process. |
|void cxxtools::posix::daemonize||(||const std::string &||pidfile = ||)|
This function makes a background daemon process out of the current process.
The current process is forked twice and the 2 parents are exited, so that only the single child is kept. The standard input, standard output and standard error output are redirected to /dev/null. When a pidfile is passed, the pid of the child is written to that file and a signal handler is installed, which removes the file, when the process is terminated unsing SIGTERM.