From 8e1cc8ab095d6dcacda45e5f248150fe163cd4cb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 Apr 2012 14:07:45 -0700 Subject: [PATCH] init-ceph: manage pid_file from init script With upstart the daemon shouldn't manage the pid file itself. Move this out of the default config and into the legacy sysvinit script. Signed-off-by: Sage Weil --- src/common/config_opts.h | 2 +- src/init-ceph.in | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 46a3708763153..6d4f30a526de2 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -34,7 +34,7 @@ OPTION(log_to_syslog, OPT_BOOL, false) OPTION(err_to_syslog, OPT_BOOL, false) OPTION(clog_to_monitors, OPT_BOOL, true) OPTION(clog_to_syslog, OPT_BOOL, false) -OPTION(pid_file, OPT_STR, "/var/run/ceph/$cluster.$name.$pid") +OPTION(pid_file, OPT_STR, "") OPTION(chdir, OPT_STR, "/") OPTION(max_open_files, OPT_LONGLONG, 0) diff --git a/src/init-ceph.in b/src/init-ceph.in index afbd1d10df8eb..260b0164309f9 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -175,13 +175,18 @@ for name in $what; do check_host || continue + binary="$BINDIR/ceph-$type" + cmd="$binary -i $id" + 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" [ -n "$log_dir" ] && do_cmd "mkdir -p $log_dir" - binary="$BINDIR/ceph-$type" if [ "$command" = "start" ]; then get_conf auto_start "" "auto start" if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then @@ -203,8 +208,6 @@ for name in $what; do fi fi - cmd="$binary -i $id" - # conf file if [ "$host" = "$hostname" ]; then cur_conf=$conf -- 2.39.5