removed boost::filesystem dependency
[senf.git] / Utils / DaemonTools.hh
index 5f20682..466e592 100644 (file)
 
 /** \defgroup process Process Management
 
-    This collection of utilities provides help in managing daemon processes.
+    Future features:
 
-    \idea Add communication between parent and child process to daemonize() and add things like
-       init_done(), failure() etc which allow the daemon process to tell the frontend of successful
-       startup or failure. This proabably means moving all the methods into a DaemonTools class (as
-       statics or via a singleton). This would also allow for automatic pid file creation and
-       removal (remove in global destructor).
+    \li Daemon manager watching the real daemon. Auto-restart, when the daemon fails
 
-    \idea Add a DaemonProcess baseclass whith init() and main() abstract members which wraps the
-       startup process. DaeminProcess::run() would fork, call init(), create a pid file and then
-       call main(). Exceptions during init()'s execution would be passed to the parent
-       process. This is based on the above API.
+    \li Provide access to the config console indirectly via the daemon manager. This allows to
+        connect to the daemon manager console even if the app is not running
     
+    \li For this to be efficient, the daemon manager must be it's own executable (e.g. senf-launch)
+
+    \li auto-detect whether called from senf-launch or not
+
+    \li when daemon is running, the console is transparently forwarded to the daemon. The daemon
+        however can still access the daemon manager as a subgroup
+    
+    \li No idea, whether this is sensible: Make the daemon manager completely self-contained (not
+        dependent on any external OS support) by providing our own log-file rotation support.
+
+    This collection of utilities provides help in managing daemon processes.
+
     \idea A closeall()/closemost() function which is useful when starting child processes. We'll use
-       getrlimit to now the biggest filehandle and close all of em. closemost() takes a number of
-       file handles as arg and will keep those open.
+        getrlimit to now the biggest filehandle and close all of em. closemost() takes a number of
+        file handles as arg and will keep those open.
 
     \idea We might want to add other oft used utitlities: chroot(), setreuid(), pipes() / IPC ...
  */
@@ -58,11 +64,11 @@ namespace senf {
 
     void daemonize();                   ///< Make the current process a daemon process
                                         /**< daemonize() will fork, detach from the controlling
-                                            terminal and start a new process group. */
+                                             terminal and start a new process group. */
     void redirect_stdio(std::string const & path = "/dev/null"); ///< Redirect STDIN, STDOUT and STDERR
                                         /**< All standard file-descriptors will be redirected to the
-                                            given path defaulting to <tt>/dev/null</tg>
-                                            \param[in] path path to redirect to */
+                                             given path defaulting to <tt>/dev/null</tt>
+                                             \param[in] path path to redirect to */
 
     /// @}
 }
@@ -77,6 +83,10 @@ namespace senf {
 \f
 // Local Variables:
 // mode: c++
-// c-file-style: "senf"
 // fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
 // End: