]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
add -f flag for foreground execution of modules (with logs in the log files)
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 3 Oct 2008 18:54:53 +0000 (11:54 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 3 Oct 2008 18:54:53 +0000 (11:54 -0700)
src/config.cc
src/config.h

index 2b5bf745df9cf5781423ad4394f5e607d62fa3a8..4aecfdff167631ef060282732266e6f183ff8a5b 100644 (file)
@@ -194,6 +194,7 @@ md_config_t g_conf = {
 
   mon_host: 0,
   daemonize: false,
+  file_logs: false,
 
   // profiling and debugging
   log: true,
@@ -609,8 +610,14 @@ void parse_config_options(std::vector<const char*>& args, bool open)
             strcmp(args[i], "-m") == 0)
       g_conf.mon_host = args[++i];    
     else if (strcmp(args[i], "--daemonize") == 0 ||
-            strcmp(args[i], "-d") == 0)
-      g_conf.daemonize = true;      
+            strcmp(args[i], "-d") == 0) {
+      g_conf.daemonize = true;
+      g_conf.file_logs = true;
+    } else if (strcmp(args[i], "--foreground") == 0 ||
+            strcmp(args[i], "-f") == 0) {
+      g_conf.daemonize = false;
+      g_conf.file_logs = true;
+    }
 
     else if (strcmp(args[i], "--ms_hosts") == 0)
       g_conf.ms_hosts = args[++i];
@@ -1146,7 +1153,7 @@ void parse_config_options(std::vector<const char*>& args, bool open)
       g_conf.dout_dir = 0;
   }
   */
-  if (g_conf.dout_dir && g_conf.daemonize && open) {
+  if (g_conf.dout_dir && g_conf.file_logs && open) {
     char fn[80];
     char hostname[80];
     gethostname(hostname, 79);
index 49e27a9ea3483eee2ba061c5004a28f391455a38..4af715bcd0b1bd43578750cd7c507c294d09bc37 100644 (file)
@@ -50,6 +50,7 @@ struct md_config_t {
   
   const char *mon_host;
   bool daemonize;
+  bool file_logs;
 
   // profiling
   bool  log;