Scheduler: Daemon class: Better IPC in daemonize()
[senf.git] / Scheduler / Daemon.hh
index 38aed48..3526cb3 100644 (file)
@@ -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_;