]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
config: use sane default paths for logs; use .conf for *start.sh
authorSage Weil <sage@newdream.net>
Thu, 26 Feb 2009 22:50:38 +0000 (14:50 -0800)
committerSage Weil <sage@newdream.net>
Thu, 26 Feb 2009 22:50:38 +0000 (14:50 -0800)
Specify sane deafult paths for logs (/var/log/ceph/*).  Use workingdir.conf
when starting up from dstart.sh or vstart.sh to use directories relative
to the current (presumably, build) directory.

src/config.cc
src/dstart.sh
src/vstart.sh
src/workingdir.conf [new file with mode: 0644]

index 9a5071d6ce7f166d0abf1a2b23a595739e394ff0..6a28ec1a36006e3a921c818c79bc219e1cb0f179 100644 (file)
@@ -208,9 +208,9 @@ md_config_t g_conf = {
 
   logger_calc_variance: true,
 
-  dout_dir: "out",        // if daemonize == true
-  dout_sym_dir: "out",    // if daemonize == true
-  logger_dir: "log",
+  dout_dir: "/var/log/ceph",        // if daemonize == true
+  dout_sym_dir: "/var/log/ceph",    // if daemonize == true
+  logger_dir: "/var/log/ceph/stat",
 
   conf_file: "ceph.conf",
   dump_conf: false,
index 6bb09487d799bec492db3799a643a0a84d50f200..71aabcdce151f61c5ddc2a8a52608320e4d84514 100755 (executable)
@@ -6,6 +6,8 @@ let stopfirst=1
 let ramjournal=0
 norestart="--norestart"
 
+conf="workingdir.conf"
+
 while [ $# -ge 1 ]; do
     case $1 in
         -d | --debug )
@@ -36,14 +38,14 @@ ARGS="--dout_dir /data/`hostname`"
 MOUNTOPTIONS="-o notreelog,flushoncommit"
 
 if [ $debug -eq 0 ]; then
-    CMON_ARGS="--debug_mon 10 --debug_ms 1"
-    COSD_ARGS=""
-    CMDS_ARGS="--file_layout_pg_size 3 --debug_ms 1"
+    CMON_ARGS="--conf_file $conf --debug_mon 10 --debug_ms 1"
+    COSD_ARGS="--conf_file $conf "
+    CMDS_ARGS="--conf_file $conf --file_layout_pg_size 3 --debug_ms 1"
 else
     echo "** going verbose **"
-    CMON_ARGS="--lockdep 1 --debug_mon 20 --debug_ms 1 --debug_paxos 20"
-    COSD_ARGS="--lockdep 1 --debug_osd 20 --debug_journal 20 --debug_filestore 0 --debug_ms 1" # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
-    CMDS_ARGS="--file_layout_pg_size 3 --lockdep 1 --mds_cache_size 500 --mds_log_max_segments 2 --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 --mds_thrash_exports 0"
+    CMON_ARGS="--conf_file $conf --lockdep 1 --debug_mon 20 --debug_ms 1 --debug_paxos 20"
+    COSD_ARGS="--conf_file $conf --lockdep 1 --debug_osd 20 --debug_journal 20 --debug_filestore 0 --debug_ms 1" # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
+    CMDS_ARGS="--conf_file $conf --file_layout_pg_size 3 --lockdep 1 --mds_cache_size 500 --mds_log_max_segments 2 --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 --mds_thrash_exports 0"
 fi
 
 
index 6cd66af4bbc084f66bf4069d2e16f62b85df91be..dd94d628df29422557d2a868ad2286d0e372ca94 100755 (executable)
@@ -15,6 +15,8 @@ norestart=""
 valgrind=""
 MON_ADDR=""
 
+conf="workingdir.conf"
+
 usage="usage: $0 [option]... [mon] [mds] [osd]\n"
 usage=$usage"options:\n"
 usage=$usage"\t-d, --debug\n"
@@ -77,14 +79,14 @@ fi
 ARGS="-f"
 
 if [ $debug -eq 0 ]; then
-       CMON_ARGS="--debug_mon 10 --debug_ms 1"
-       COSD_ARGS=""
-       CMDS_ARGS="--debug_ms 1"
+       CMON_ARGS="--conf_file $conf --debug_mon 10 --debug_ms 1"
+       COSD_ARGS="--conf_file $conf "
+       CMDS_ARGS="--conf_file $conf --debug_ms 1"
 else
        echo "** going verbose **"
-       CMON_ARGS="--lockdep 1 --debug_mon 20 --debug_ms 1 --debug_paxos 20"
-       COSD_ARGS="--lockdep 1 --debug_osd 25 --debug_journal 20 --debug_filestore 10 --debug_ms 1" # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
-       CMDS_ARGS="--lockdep 1 --mds_cache_size 500 --mds_log_max_segments 2 --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 --mds_thrash_exports 1"
+       CMON_ARGS="--conf_file $conf --lockdep 1 --debug_mon 20 --debug_ms 1 --debug_paxos 20"
+       COSD_ARGS="--conf_file $conf --lockdep 1 --debug_osd 25 --debug_journal 20 --debug_filestore 10 --debug_ms 1" # --debug_journal 20 --debug_osd 20 --debug_filestore 20 --debug_ebofs 20
+       CMDS_ARGS="--conf_file $conf --lockdep 1 --mds_cache_size 500 --mds_log_max_segments 2 --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 --mds_thrash_exports 1"
 fi
 
 if [ "$MON_ADDR" != "" ]; then
@@ -108,6 +110,7 @@ $SUDO rm -f core*
 
 test -d out || mkdir out
 $SUDO rm -f out/*
+test -d log && rm log/*
 test -d gmon && $SUDO rm -rf gmon/*
 
 
diff --git a/src/workingdir.conf b/src/workingdir.conf
new file mode 100644 (file)
index 0000000..9955af2
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# specify log, stat paths relative to the current directory.  useful
+# when running out of the directory you've compiled in.
+#
+[global]
+       dout dir = out
+       dout sym dir = out
+       logger dir = log