From: Danny Al-Gaaf Date: Thu, 14 Feb 2013 12:39:28 +0000 (+0100) Subject: init-ceph.in: create pid and log dir only on start X-Git-Tag: v0.58~70^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=97c6ce0a2ece72afc39957aca7d4fc3a36437f2f;p=ceph.git init-ceph.in: create pid and log dir only on start Create pid and log dir only on start and not e.g. also on stop. These calls are useless in other situtations than startup the cluster or process. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/init-ceph.in b/src/init-ceph.in index 121b03f22ab7..3513a6877339 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -180,15 +180,16 @@ for name in $what; do cmd="$binary -i $id" get_conf pid_file "$RUN_DIR/$type.$id.pid" "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" if [ "$command" = "start" ]; then + 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" + get_conf auto_start "" "auto start" if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then if [ -z "$@" ]; then