]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
config: default to -d for server daemons; -D/--nodaemon for foreground operation
authorSage Weil <sage@newdream.net>
Tue, 10 Mar 2009 21:43:07 +0000 (14:43 -0700)
committerSage Weil <sage@newdream.net>
Tue, 10 Mar 2009 21:43:07 +0000 (14:43 -0700)
man/Makefile.am
man/cosd.8
src/cmds.cc
src/cmon.cc
src/config.cc
src/config.h
src/cosd.cc
src/init-ceph
src/vstart.sh

index 120ced2e69a31782eb5e7e618478c36e81befe5f..1e520085a4db724eb5624a79dff39aed311c144c 100644 (file)
@@ -1,4 +1,4 @@
 AUTOMAKE_OPTIONS = gnu
 
-man_MANS = cosd.8
-dist_man_MANS = cosd.8
\ No newline at end of file
+man_MANS = cosd.8 mkcephfs.8
+dist_man_MANS = cosd.8 mkcephfs.8
\ No newline at end of file
index 0d8e6075c2f3bb47251d67002d31cc8a7b2a6e66..de62f92904490178c6b6ad2dad521b87c0590b63 100644 (file)
@@ -3,7 +3,6 @@
 cosd \- ceph object storage daemon
 .SH SYNOPSIS
 .B cosd
-[ \fB\-d\fP ]
 \fIdatapath\fP
 [ \fB\-j\fI journal\fP ]
 [ \fB\-c\fI ceph.conf\fP ]
@@ -18,16 +17,15 @@ The \fIdatapath\fP argument should be a directory on a btrfs file
 system where the object data resides.  The \fIjournal\fP is optional,
 and is only useful performance-wise when it resides on a different
 disk than \fIdatapath\fP with low latency (ideally, an NVRAM device).
-.PP
-If neither \fB-d\fP nor \fB-f\fP is specified, the daemon will run
-in the foreground and log to stdout.
 .SH OPTIONS
 .TP
-\fB\-d\fP
-daemonize after startup.
+\fB\-D\fP
+Debug mode: do not daemonize after startup (run in foreground) and send log output
+to stdout.
 .TP
 \fB\-f\fP
-do not daemonize after startup (run in foreground).  Useful when run via 
+do not daemonize after startup (run in foreground), but log to the usual location.
+Useful when run via 
 .BR crun (8).
 .TP
 \fB\-j\fI journal\fP
index b79f70aecf525e2832da539458d5c576743d1b83..cebec150126e22684fda95d29f05c35521b40bc4 100644 (file)
@@ -38,6 +38,7 @@ int main(int argc, const char **argv)
   vector<const char*> args;
   argv_to_vec(argc, argv, args);
   env_to_vec(args);
+  configure_daemon_mode();
   common_init(args);
 
   // mds specific args
index 05e35b4a286a368117d6d2e224832a51a17d7002..09c85646549ddd1afe57fec1cbf4ddcd1aaa1b06 100644 (file)
@@ -51,6 +51,7 @@ int main(int argc, const char **argv)
   vector<const char*> args;
   argv_to_vec(argc, argv, args);
   env_to_vec(args);
+  configure_daemon_mode();
   common_init(args);
 
   // args
index f4783ce3fcf5819e127ddf6e10516fe8f8109878..2390c093675dc45094ec86bbc38ad63085bbd7a9 100644 (file)
@@ -766,6 +766,9 @@ void parse_startup_config_options(std::vector<const char*>& args)
        SET_BOOL_ARG_VAL(&g_conf.dump_conf);
     } else if (CMD_EQ("bind", 0)) {
       assert_warn(parse_ip_port(args[++i], g_my_addr));
+    } else if (CMD_EQ("nodaemon", 'D')) {
+      g_conf.daemonize = false;
+      g_conf.log_to_stdout = true;
     } else if (CMD_EQ("daemonize", 'd')) {
       g_conf.daemonize = true;
       g_conf.log_to_stdout = false;
@@ -786,6 +789,17 @@ void parse_startup_config_options(std::vector<const char*>& args)
     cf.dump();
 }
 
+void configure_daemon_mode()
+{
+  g_conf.daemonize = true;
+  g_conf.log_to_stdout = false;
+}
+void configure_client_mode()
+{
+  g_conf.daemonize = false;
+  g_conf.log_to_stdout = true;
+}
+
 void parse_config_options(std::vector<const char*>& args)
 {
   int opt_len = sizeof(config_optionsp)/sizeof(config_option);
index 6ba5b2f27cf8bd3379dd9f420d0be12b78d564ce..948ca34e8f86e86d8c6322439fe52f551f454a00 100644 (file)
@@ -358,6 +358,9 @@ void parse_config_option_string(string& s);
 
 extern bool parse_ip_port(const char *s, entity_addr_t& addr, const char **end=0);
 
+void configure_daemon_mode();
+void configure_client_mode();
+
 class ConfFile;
 
 void parse_config_file(ConfFile *cf, bool update);
index 349d55807103b057511e8146028e4d1dca9128ac..85ce2e146b9f37b1f419c9a1c1097058ba275122 100644 (file)
@@ -40,8 +40,6 @@ void usage()
   cerr << "   -d              daemonize" << std::endl;
   cerr << "   --debug_osd N   set debug level (e.g. 10)" << std::endl;
   cerr << "   --debug_ms N    set message debug level (e.g. 1)" << std::endl;
-  cerr << "   --ebofs         use EBOFS for object storage (default)" << std::endl;
-  cerr << "   --fakestore     store objects as files in directory <device>" << std::endl;
   exit(1);
 }
 
@@ -51,6 +49,7 @@ int main(int argc, const char **argv)
   vector<const char*> args;
   argv_to_vec(argc, argv, args);
   env_to_vec(args);
+  configure_daemon_mode();
   common_init(args);
 
   if (g_conf.clock_tare) g_clock.tare();
index c5170f85a0b73b0113a89ee98cf8579620bae653..0b5621a2ed16cc606156c3cb4b5c32521fe05ac8 100755 (executable)
@@ -171,7 +171,7 @@ for name in $what; do
        start)
             # build final command
            wrap=""
-           runflags="-d"
+           runflags=""
            runmode=""
            
            get_conf_bool crun "$docrun" "restart on core dump" $sections
index c3cd9badb821c8e4427b1f95b4e0594b75e1d79e..84b15fd59db506fbbd85fef7179471d5e365848d 100755 (executable)
@@ -72,7 +72,7 @@ if [ $start_all -eq 1 ]; then
        start_osd=1
 fi
 
-ARGS="-d -c $conf"
+ARGS="-c $conf"
 
 if [ $debug -eq 0 ]; then
        CMON_ARGS="--debug_mon 10 --debug_ms 1"