From: Yehuda Sadeh Date: Fri, 3 Oct 2008 18:54:53 +0000 (-0700) Subject: add -f flag for foreground execution of modules (with logs in the log files) X-Git-Tag: v0.4~40 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14305a37ca7a3cdf7f1b1bd1ed4224aa7bf279fa;p=ceph.git add -f flag for foreground execution of modules (with logs in the log files) --- diff --git a/src/config.cc b/src/config.cc index 2b5bf745df9c..4aecfdff1676 100644 --- a/src/config.cc +++ b/src/config.cc @@ -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& 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& 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); diff --git a/src/config.h b/src/config.h index 49e27a9ea348..4af715bcd0b1 100644 --- a/src/config.h +++ b/src/config.h @@ -50,6 +50,7 @@ struct md_config_t { const char *mon_host; bool daemonize; + bool file_logs; // profiling bool log;