From 2a534d70553c2a56dd562c6350ea33e1866576c0 Mon Sep 17 00:00:00 2001 From: Paul Chiang Date: Tue, 6 Jul 2010 11:24:42 +0800 Subject: [PATCH] init-ceph: mkdir log_dir and log_sym_dir Signed-off-by: Sage Weil --- src/init-ceph.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/init-ceph.in b/src/init-ceph.in index 6af3fc159fc..43765b3c79d 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -188,6 +188,11 @@ for name in $what; do get_conf pid_file "/var/run/ceph/$type.$id.pid" "pid file" [ -n "$pid_file" ] && mkdir -p `dirname $pid_file` + get_conf log_dir "/var/log/ceph" "log dir" + get_conf log_sym_dir "/var/log/ceph" "log sym dir" + [ -n "$log_dir" ] && mkdir -p $log_dir + [ -n "$log_sym_dir" ] && mkdir -p $log_sym_dir + # start, and already running? (do this check early to avoid unnecessary work!) if [ "$command" = "start" ]; then if daemon_is_running $name c$type $pid_file; then @@ -307,15 +312,11 @@ for name in $what; do cleanlogs) echo removing logs - get_conf log_dir "/var/log/ceph" "log dir" - get_conf log_sym_dir "/var/log/ceph" "log sym dir" do_cmd "for f in $log_sym_dir/$name*; do rm -f \`readlink \$f\` ; rm -f \$f ; done" ;; cleanalllogs) echo removing all logs - get_conf log_dir "/var/log/ceph" "log dir" - get_conf log_sym_dir "/var/log/ceph" "log sym dir" do_cmd "rm -f $log_dir/* $log_sym_dir/* || true" ;;