Merge remote branch 'gh/wip-defaults'

This commit is contained in:
Sage Weil 2012-04-12 22:36:48 -07:00
commit 1e76a8713f
3 changed files with 22 additions and 15 deletions

View File

@ -51,11 +51,6 @@ CephContext *common_preinit(const CephInitParameters &iparams,
switch (code_env) { switch (code_env) {
case CODE_ENVIRONMENT_DAEMON: case CODE_ENVIRONMENT_DAEMON:
conf->set_val_or_die("daemonize", "true"); conf->set_val_or_die("daemonize", "true");
if (!(flags & CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS)) {
conf->set_val_or_die("pid_file", "/var/run/ceph/$type.$id.pid");
conf->set_val_or_die("admin_socket", "/var/run/ceph/$name.asok");
conf->set_val_or_die("log_file", "/var/log/ceph/$name.log");
}
conf->set_val_or_die("log_to_stderr", "false"); conf->set_val_or_die("log_to_stderr", "false");
conf->set_val_or_die("err_to_stderr", "true"); conf->set_val_or_die("err_to_stderr", "true");
break; break;
@ -68,6 +63,15 @@ CephContext *common_preinit(const CephInitParameters &iparams,
default: default:
break; break;
} }
if ((flags & CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS) ||
code_env != CODE_ENVIRONMENT_DAEMON) {
// no default log, pid_file, admin_socket
conf->set_val_or_die("pid_file", "");
conf->set_val_or_die("admin_socket", "");
conf->set_val_or_die("log_file", "");
}
return cct; return cct;
} }

View File

@ -24,8 +24,8 @@ OPTION(monmap, OPT_STR, "")
OPTION(mon_host, OPT_STR, "") OPTION(mon_host, OPT_STR, "")
OPTION(daemonize, OPT_BOOL, false) OPTION(daemonize, OPT_BOOL, false)
OPTION(lockdep, OPT_BOOL, false) OPTION(lockdep, OPT_BOOL, false)
OPTION(admin_socket, OPT_STR, "") OPTION(admin_socket, OPT_STR, "/var/run/ceph/$cluster.name.asok")
OPTION(log_file, OPT_STR, "") OPTION(log_file, OPT_STR, "/var/log/ceph/$cluster.$name.log")
OPTION(log_max_new, OPT_INT, 1000) OPTION(log_max_new, OPT_INT, 1000)
OPTION(log_max_recent, OPT_INT, 1000000) OPTION(log_max_recent, OPT_INT, 1000000)
OPTION(log_to_stderr, OPT_BOOL, true) OPTION(log_to_stderr, OPT_BOOL, true)
@ -76,7 +76,7 @@ SUBSYS(hadoop, 1, 5)
OPTION(key, OPT_STR, "") OPTION(key, OPT_STR, "")
OPTION(keyfile, OPT_STR, "") OPTION(keyfile, OPT_STR, "")
OPTION(keyring, OPT_STR, "/etc/ceph/keyring,/etc/ceph/keyring.bin") OPTION(keyring, OPT_STR, "/etc/ceph/$cluster.keyring,/etc/ceph/keyring,/etc/ceph/keyring.bin")
OPTION(heartbeat_interval, OPT_INT, 5) OPTION(heartbeat_interval, OPT_INT, 5)
OPTION(heartbeat_file, OPT_STR, "") OPTION(heartbeat_file, OPT_STR, "")
OPTION(ms_tcp_nodelay, OPT_BOOL, true) OPTION(ms_tcp_nodelay, OPT_BOOL, true)
@ -89,7 +89,7 @@ OPTION(ms_bind_ipv6, OPT_BOOL, false)
OPTION(ms_rwthread_stack_bytes, OPT_U64, 1024 << 10) OPTION(ms_rwthread_stack_bytes, OPT_U64, 1024 << 10)
OPTION(ms_tcp_read_timeout, OPT_U64, 900) OPTION(ms_tcp_read_timeout, OPT_U64, 900)
OPTION(ms_inject_socket_failures, OPT_U64, 0) OPTION(ms_inject_socket_failures, OPT_U64, 0)
OPTION(mon_data, OPT_STR, "") OPTION(mon_data, OPT_STR, "/var/lib/ceph/mon/$cluster-$id")
OPTION(mon_sync_fs_threshold, OPT_INT, 5) // sync() when writing this many objects; 0 to disable. OPTION(mon_sync_fs_threshold, OPT_INT, 5) // sync() when writing this many objects; 0 to disable.
OPTION(mon_tick_interval, OPT_INT, 5) OPTION(mon_tick_interval, OPT_INT, 5)
OPTION(mon_subscribe_interval, OPT_DOUBLE, 300) OPTION(mon_subscribe_interval, OPT_DOUBLE, 300)
@ -242,8 +242,8 @@ OPTION(osd_auto_upgrade_tmap, OPT_BOOL, true)
// If true, TMAPPUT sets uses_tmap DEBUGGING ONLY // If true, TMAPPUT sets uses_tmap DEBUGGING ONLY
OPTION(osd_tmapput_sets_uses_tmap, OPT_BOOL, false) OPTION(osd_tmapput_sets_uses_tmap, OPT_BOOL, false)
OPTION(osd_data, OPT_STR, "") OPTION(osd_data, OPT_STR, "/var/lib/ceph/osd/$cluster-$id")
OPTION(osd_journal, OPT_STR, "") OPTION(osd_journal, OPT_STR, "/var/lib/ceph/osd/$cluster-$id/journal")
OPTION(osd_journal_size, OPT_INT, 0) // in mb OPTION(osd_journal_size, OPT_INT, 0) // in mb
OPTION(osd_max_write_size, OPT_INT, 90) OPTION(osd_max_write_size, OPT_INT, 90)
OPTION(osd_balance_reads, OPT_BOOL, false) OPTION(osd_balance_reads, OPT_BOOL, false)

View File

@ -175,13 +175,18 @@ for name in $what; do
check_host || continue check_host || continue
binary="$BINDIR/ceph-$type"
cmd="$binary -i $id"
get_conf pid_file "$RUN_DIR/$type.$id.pid" "pid file" get_conf pid_file "$RUN_DIR/$type.$id.pid" "pid file"
[ -n "$pid_file" ] && do_cmd "mkdir -p "`dirname $pid_file` if [ -n "$pid_file" ]; then
do_cmd "mkdir -p "`dirname $pid_file`
cmd="$cmd --pid-file $pid_file"
fi
get_conf log_dir "" "log dir" get_conf log_dir "" "log dir"
[ -n "$log_dir" ] && do_cmd "mkdir -p $log_dir" [ -n "$log_dir" ] && do_cmd "mkdir -p $log_dir"
binary="$BINDIR/ceph-$type"
if [ "$command" = "start" ]; then if [ "$command" = "start" ]; then
get_conf auto_start "" "auto start" get_conf auto_start "" "auto start"
if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then
@ -203,8 +208,6 @@ for name in $what; do
fi fi
fi fi
cmd="$binary -i $id"
# conf file # conf file
if [ "$host" = "$hostname" ]; then if [ "$host" = "$hostname" ]; then
cur_conf=$conf cur_conf=$conf