2015-05-14 15:30:55 +02:00
|
|
|
#ifndef DAEMON_H
|
|
|
|
#define DAEMON_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2015-05-21 13:35:30 +02:00
|
|
|
// Daemonizes the process if daemonize is true.
|
|
|
|
// If daemonize is true, it will write the new PID to the file "pidFile"
|
|
|
|
//
|
|
|
|
// This function will also redirect stdin, out and err to the
|
|
|
|
// specified files
|
2015-09-16 22:59:14 +02:00
|
|
|
void daemonize(const std::string &dir,
|
2015-05-14 15:30:55 +02:00
|
|
|
const std::string &stdinfile,
|
|
|
|
const std::string &stdoutfile,
|
2015-09-16 22:59:14 +02:00
|
|
|
const std::string &stderrfile);
|
2015-05-14 15:30:55 +02:00
|
|
|
|
|
|
|
#endif
|