Skip to content

Commit

Permalink
init-ceph.in: create pid and log dir only on start
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dalgaaf committed Feb 14, 2013
1 parent ccdcae3 commit 97c6ce0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/init-ceph.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97c6ce0

Please sign in to comment.