From fc846370c13a5a79daa35ac58c4363cb6a9708a6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Mar 2009 16:08:00 -0700 Subject: [PATCH] config: -c foo or --conf=foo; -C bar or --cluster-conf=bar --- man/cmds.8 | 7 +++++-- man/cmon.8 | 7 +++++-- man/cosd.8 | 7 +++++-- man/mkcephfs.8 | 4 ++-- src/cconf.cc | 2 +- src/config.cc | 14 +++++++------- src/config.h | 4 ++-- src/cosd.cluster.conf | 2 +- src/init-ceph | 6 +++--- src/mkcephfs | 8 ++++---- src/mon/MonClient.cc | 2 +- src/sample.cluster.conf | 2 +- 12 files changed, 37 insertions(+), 28 deletions(-) diff --git a/man/cmds.8 b/man/cmds.8 index a774c8f11bac4..cd91eefcc62d7 100644 --- a/man/cmds.8 +++ b/man/cmds.8 @@ -5,7 +5,6 @@ cmds \- ceph metadata server daemon .B cmds [ \fB\-\-mds\fI rank\fP ] [ \fB\-\-shadow\fI rank\fP ] -[ \fB\-c\fI ceph.conf\fP ] .SH DESCRIPTION .B cmds is the metadata server daemon for the Ceph distributed file system. @@ -32,9 +31,13 @@ do not daemonize after startup (run in foreground), but log to the usual locatio Useful when run via .BR crun (8). .TP -\fB\-c\fI ceph.conf\fR or \fB\-\-conf_file\fI ceph.conf\fP +\fB\-c\fI ceph.conf\fR, \fB\-\-conf=\fIceph.conf\fR Use \fIceph.conf\fP configuration file instead of the default \fI/etc/ceph/ceph.conf\fP for runtime configuration options. +.TP +\fB\-C\fI cluster.conf\fR, \fB\-\-cluster-conf=\fIcluster.conf\fR +Use \fIcluster.conf\fP cluster configuration file instead of the default \fI/etc/ceph/cluster.conf\fP +to determine monitor addresses during startup. .SH AVAILABILITY .B cmon is part of the Ceph distributed file system. Please refer to the Ceph wiki at diff --git a/man/cmon.8 b/man/cmon.8 index d946605633849..7cad1297fe0fd 100644 --- a/man/cmon.8 +++ b/man/cmon.8 @@ -4,7 +4,6 @@ cmon \- ceph monitor daemon .SH SYNOPSIS .B cmon \fImondatapath\fP -[ \fB\-c\fI ceph.conf\fP ] .SH DESCRIPTION .B cmon is the cluster monitor daemon for the Ceph distributed file system. @@ -26,9 +25,13 @@ do not daemonize after startup (run in foreground), but log to the usual locatio Useful when run via .BR crun (8). .TP -\fB\-c\fI ceph.conf\fR or \fB\-\-conf_file\fI ceph.conf\fP +\fB\-c\fI ceph.conf\fR, \fB\-\-conf=\fIceph.conf\fR Use \fIceph.conf\fP configuration file instead of the default \fI/etc/ceph/ceph.conf\fP for runtime configuration options. +.TP +\fB\-C\fI cluster.conf\fR, \fB\-\-cluster-conf=\fIcluster.conf\fR +Use \fIcluster.conf\fP cluster configuration file instead of the default \fI/etc/ceph/cluster.conf\fP +to determine monitor addresses during startup. .SH AVAILABILITY .B cmon is part of the Ceph distributed file system. Please refer to the Ceph wiki at diff --git a/man/cosd.8 b/man/cosd.8 index 1b9d6b23732a0..761ffead04806 100644 --- a/man/cosd.8 +++ b/man/cosd.8 @@ -5,7 +5,6 @@ cosd \- ceph object storage daemon .B cosd \fIdatapath\fP [ \fB\-j\fI journal\fP ] -[ \fB\-c\fI ceph.conf\fP ] [ \fB\-\-mkfs_for_osd\fI nodeid\fP ] .SH DESCRIPTION .B cosd @@ -36,9 +35,13 @@ Create an empty object repository for OSD number \fInodeid\fP. Normally invoked by .BR mkcephfs (8). .TP -\fB\-c\fI ceph.conf\fR or \fB\-\-conf_file\fI ceph.conf\fP +\fB\-c\fI ceph.conf\fR, \fB\-\-conf=\fIceph.conf\fR Use \fIceph.conf\fP configuration file instead of the default \fI/etc/ceph/ceph.conf\fP for runtime configuration options. +.TP +\fB\-C\fI cluster.conf\fR, \fB\-\-cluster-conf=\fIcluster.conf\fR +Use \fIcluster.conf\fP cluster configuration file instead of the default \fI/etc/ceph/cluster.conf\fP +to determine monitor addresses during startup. .SH AVAILABILITY .B cosd is part of the Ceph distributed file system. Please refer to the Ceph wiki at diff --git a/man/mkcephfs.8 b/man/mkcephfs.8 index 706bb3c6b7010..baa8201fbb0db 100644 --- a/man/mkcephfs.8 +++ b/man/mkcephfs.8 @@ -4,7 +4,7 @@ cosd \- ceph object storage daemon .SH SYNOPSIS .B cosd [ \fB\-a\fP ] -[ \fB\-c\fP\fI cluster.conf\fP ] +[ \fB\-C\fP\fI cluster.conf\fP ] [ \fB\-\-clobber_old_data\fP ] [ \fB\-\-mkbtrfs\fP ] .SH DESCRIPTION @@ -20,7 +20,7 @@ metadata. Performs the necessary initialization steps on all hosts in the cluster, executing commands via SSH. .TP -\fB\-c\fR, \fB\-\-conf_file \fIcluster.conf\fR +\fB\-C\fI cluster.conf\fR, \fB\-\-cluster-conf=\fIcluster.conf\fR Use the given cluster conf file instead of the default \fI/etc/ceph/cluster.conf\fP. .TP \fB\-\-clobber_old_data\fR diff --git a/src/cconf.cc b/src/cconf.cc index 5b98b9c237ebf..b19118db28a6b 100644 --- a/src/cconf.cc +++ b/src/cconf.cc @@ -20,7 +20,7 @@ void usage() int main(int argc, const char **argv) { - const char *fname = g_conf.conf_file; + const char *fname = g_conf.conf; const char *key = NULL, *defval = NULL; const char *list_sections = 0; char *val; diff --git a/src/config.cc b/src/config.cc index 7cf9f47efc10f..e69b38b001dc2 100644 --- a/src/config.cc +++ b/src/config.cc @@ -356,8 +356,8 @@ static struct config_option config_optionsp[] = { OPTION(global, log_sym_dir, 0, STR, INSTALL_PREFIX "/var/log/ceph"), // if daemonize == true OPTION(global, log_to_stdout, 0, BOOL, true), OPTION(global, pid_file, 'p', STR, 0), - OPTION(global, conf_file, 'c', STR, INSTALL_PREFIX "/etc/ceph/ceph.conf"), - OPTION(global, cluster_conf_file, 'C', STR, INSTALL_PREFIX "/etc/ceph/cluster.conf"), + OPTION(global, conf, 'c', STR, INSTALL_PREFIX "/etc/ceph/ceph.conf"), + OPTION(global, cluster_conf, 'C', STR, INSTALL_PREFIX "/etc/ceph/cluster.conf"), OPTION(global, dump_conf, 0, BOOL, false), OPTION(global, chdir, 0, STR, "/"), OPTION(global, fake_clock, 0, BOOL, false), @@ -757,9 +757,9 @@ void parse_startup_config_options(std::vector& args) cmd_equals(args[i], str_cmd, char_cmd, &val_pos) if (CMD_EQ("conf_file", 'c')) { - SAFE_SET_ARG_VAL(&g_conf.conf_file, STR); + SAFE_SET_ARG_VAL(&g_conf.conf, STR); } else if (CMD_EQ("cluster_conf_file", 'C')) { - SAFE_SET_ARG_VAL(&g_conf.cluster_conf_file, STR); + SAFE_SET_ARG_VAL(&g_conf.cluster_conf, STR); } else if (CMD_EQ("monmap_file", 'M')) { SAFE_SET_ARG_VAL(&g_conf.monmap_file, STR); } else if (CMD_EQ("dump_conf", 0)) { @@ -782,7 +782,7 @@ void parse_startup_config_options(std::vector& args) args.swap(nargs); nargs.clear(); - ConfFile cf(g_conf.conf_file); + ConfFile cf(g_conf.conf); parse_config_file(&cf, true); if (g_conf.dump_conf) @@ -802,9 +802,9 @@ void configure_client_mode() void generic_usage() { - cerr << " -C cluster.conf\n"; + cerr << " -C cluster.conf or --cluster-conf=cluster.conf\n"; cerr << " get monitor IP(s) from given conf (instead of /etc/ceph/cluster.conf)\n"; - cerr << " -c ceph.conf\n"; + cerr << " -c ceph.conf or --conf=ceph.conf\n"; cerr << " get runtime options from given conf file" << std::endl; } diff --git a/src/config.h b/src/config.h index 45be9fa8878d3..53852d4820171 100644 --- a/src/config.h +++ b/src/config.h @@ -64,8 +64,8 @@ struct md_config_t { const char *pid_file; - const char *conf_file; - const char *cluster_conf_file; + const char *conf; + const char *cluster_conf; bool dump_conf; const char *chdir; diff --git a/src/cosd.cluster.conf b/src/cosd.cluster.conf index a70790aba5846..58c5e693684d6 100644 --- a/src/cosd.cluster.conf +++ b/src/cosd.cluster.conf @@ -1,7 +1,7 @@ [global] pid file = /home/sage/ceph/src/out/$name.pid restart on core dump = false - conf file = /home/sage/ceph/src/cosd.ceph.conf + conf = /home/sage/ceph/src/cosd.ceph.conf [mon] [mon0] diff --git a/src/init-ceph b/src/init-ceph index 0b5621a2ed16c..83014af29b868 100755 --- a/src/init-ceph +++ b/src/init-ceph @@ -99,7 +99,7 @@ case $1 in --nobtrfs) dobtrfs=0 ;; - --conf_file | -c) + --conf | -c) [ "$2" == "" ] && usage_exit options="$options $1" shift @@ -139,7 +139,7 @@ for name in $what; do check_host || continue get_conf pid_file "/var/run/ceph/$name.pid" "pid file" $sections - get_conf conf_file "$runtime_conf" "conf file" $sections + get_conf conf "$runtime_conf" "conf" $sections # extract name-specific options from $conf if [[ $name =~ "mon" ]]; then @@ -165,7 +165,7 @@ for name in $what; do first_dev=`echo $btrfs_devs | cut '-d ' -f 1` fi - module_opt="-p $pid_file -c $conf_file $module_opt" + module_opt="-p $pid_file -c $conf $module_opt" case "$command" in start) diff --git a/src/mkcephfs b/src/mkcephfs index e44b0b65f45b1..c28c6d2f5ebd7 100755 --- a/src/mkcephfs +++ b/src/mkcephfs @@ -1,4 +1,4 @@ -#!/bin/sh +-c#!/bin/sh # if we start up with "./", assume everything else is in the current # directory too. @@ -42,7 +42,7 @@ case $1 in --mkbtrfs) mkbtrfs=1 ;; - --conf_file | -c) + --conf | -c) [ "$2" == "" ] && usage_exit shift conf=$1 @@ -117,7 +117,7 @@ for name in $what; do check_host || continue - get_conf conf_file "$runtime_conf" "conf file" $sections + get_conf conf "$runtime_conf" "conf" $sections if [[ $ssh = 1 ]] && [[ ! $pushed_to =~ " $host " ]]; then scp $osdmap $host:$osdmap @@ -141,7 +141,7 @@ for name in $what; do fi [[ $ssh != "" ]] && scp $monmap $host:$monmap - do_cmd "$BINDIR/cosd -c $conf_file --monmap_file $monmap --mkfs_for_osd $num $osd_path" + do_cmd "$BINDIR/cosd -c $conf --monmap_file $monmap --mkfs_for_osd $num $osd_path" fi if [[ $type = "mds" ]]; then diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 6571d0e9ba199..58088474f53b2 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -86,7 +86,7 @@ int MonClient::get_monmap(MonMap *pmonmap) if (!g_conf.mon_host) { // cluster conf? - ConfFile a(g_conf.cluster_conf_file); + ConfFile a(g_conf.cluster_conf); ConfFile b("cluster.conf"); ConfFile *c = 0; diff --git a/src/sample.cluster.conf b/src/sample.cluster.conf index 200c09e49bf0e..1ab7b59257b7e 100644 --- a/src/sample.cluster.conf +++ b/src/sample.cluster.conf @@ -15,7 +15,7 @@ ; global [global] - conf file = ceph.conf + conf = ceph.conf restart on core dump = true ; monitor -- 2.39.5