]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph.in: create pid and log dir only on start
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 14 Feb 2013 12:39:28 +0000 (13:39 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 14 Feb 2013 17:12:30 +0000 (18:12 +0100)
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 <danny.al-gaaf@bisect.de>
src/init-ceph.in

index 121b03f22ab79ab916a36a12b764c101075091c8..3513a6877339eaadeb2cded1167e826098629aca 100644 (file)
@@ -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