X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FDaemon.hh;h=3526cb3f760d698807b07d2ffba9c96e343af468;hb=e2ac92bd4334159ffa54e29cad2eeba5846df1f6;hp=38aed48ac31afa39bc1f6481dc756c332766f864;hpb=b22425f29e4e101079eb18b97ab70ba186ae4a87;p=senf.git diff --git a/Scheduler/Daemon.hh b/Scheduler/Daemon.hh index 38aed48..3526cb3 100644 --- a/Scheduler/Daemon.hh +++ b/Scheduler/Daemon.hh @@ -97,7 +97,8 @@ namespace senf { void daemonize(bool); ///< Configure whether to run in fore- or background bool daemon(); ///< \c true, if running as daemon - void consoleLog(std::string, StdStream which = Both); ///< Configure console log file + void consoleLog(std::string const &, StdStream which = Both); + ///< Configure console log file /**< May be called multiple times to set the log file for stdout and stderr seperately. Any standard stream not assigned to a log file will be redirected to @@ -106,7 +107,7 @@ namespace senf { When running in the foreground, the log files will be ignored. */ - void pidFile(std::string); ///< Configure pid file + void pidFile(std::string const &); ///< Configure pid file ///\} ///\name Auxiliary helpers @@ -134,13 +135,14 @@ namespace senf { protected: Daemon(); + virtual void configure(); ///< Called before forking to configure the daemon class + # ifdef DOXYGEN protected: # else private: # endif - virtual void configure(); ///< Called before forking to configure the daemon class virtual void main(); ///< Called after forking to execute the main application /**< The default implementation will call init(), detach() and then run(). It is preferred to override init() and @@ -160,6 +162,7 @@ namespace senf { implementation is not overridden. */ private: + void openLog(); void fork(); bool pidfileCreate(); @@ -167,6 +170,8 @@ namespace senf { char const ** argv_; bool daemonize_; + std::string stdoutLog_; + std::string stderrLog_; int stdout_; int stderr_; std::string pidfile_;