From: Sage Weil Date: Tue, 8 Sep 2009 21:13:04 +0000 (-0700) Subject: init-ceph: fix pre/post commands X-Git-Tag: v0.14~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3046334d0d5f2fb0180546223228345ab09cf800;p=ceph.git init-ceph: fix pre/post commands --- diff --git a/src/cosd.ceph.conf b/src/cosd.ceph.conf index 7b395ec8535e..efd25dba95e6 100644 --- a/src/cosd.ceph.conf +++ b/src/cosd.ceph.conf @@ -48,6 +48,7 @@ ; --------------------- [osd] + pre start command = "cp /home/sage/ceph/src/cosd /tmp/cosd.`date +%Y%M%d.%H%M%S`" debug ms = 1 debug osd = 20 debug filestore = 10 diff --git a/src/init-ceph.in b/src/init-ceph.in index 5b1733012564..3f7180dd352b 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -204,32 +204,32 @@ for name in $what; do get_conf pre_mount "true" "pre mount command" get_conf btrfs_opt "flushoncommit" "btrfs options" [ -n "$btrfs_opt" ] && btrfs_opt="-o $btrfs_opt" - [ -n "$pre_mount" ] && do_cmd $pre_mount + [ -n "$pre_mount" ] && do_cmd "$pre_mount" do_root_cmd "modprobe btrfs ; btrfsctl -a ; egrep -q '^[^ ]+ $btrfs_path' /proc/mounts || mount -t btrfs $btrfs_opt $first_dev $btrfs_path" fi get_conf pre_start_eval "" "pre start eval" [ -n "$pre_start_eval" ] && $pre_start_eval get_conf pre_start "" "pre start command" get_conf post_start "" "post start command" - [ -n "$pre_start" ] && do_cmd $pre_start + [ -n "$pre_start" ] && do_cmd "$pre_start" do_cmd "$cmd" $runarg - [ -n "$post_start" ] && do_cmd $post_start + [ -n "$post_start" ] && do_cmd "$post_start" ;; stop) get_conf pre_stop "" "pre stop command" get_conf post_stop "" "post stop command" - [ -n "$pre_stop" ] && do_cmd $pre_stop + [ -n "$pre_stop" ] && do_cmd "$pre_stop" stop_daemon $name c$type $pid_file - [ -n "$post_stop" ] && do_cmd $post_stop + [ -n "$post_stop" ] && do_cmd "$post_stop" ;; forcestop) get_conf pre_forcestop "" "pre forcestop command" get_conf post_forcestop "" "post forcestop command" - [ -n "$pre_forcestop" ] && do_cmd $pre_forcestop + [ -n "$pre_forcestop" ] && do_cmd "$pre_forcestop" stop_daemon $name c$type $pid_file -9 - [ -n "$post_forcestop" ] && do_cmd $post_forcestop + [ -n "$post_forcestop" ] && do_cmd "$post_forcestop" ;; killall)