From: Sage Weil Date: Thu, 3 Dec 2009 00:08:44 +0000 (-0800) Subject: init-ceph: optionally copy executable to remote host before running it X-Git-Tag: v0.18~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f3c83bfe9f44f8710c6b559f78f0a40ed5876c7f;p=ceph.git init-ceph: optionally copy executable to remote host before running it This both preserves the version of the binary that we ran (for interpreting core files) and avoids any possibility of SIGBUS due to nfs lameness when rarely used text pages get faulted back in. --- diff --git a/src/ceph.conf.sepia b/src/ceph.conf.sepia index 13da83f1da8..877d56b8b5a 100644 --- a/src/ceph.conf.sepia +++ b/src/ceph.conf.sepia @@ -13,7 +13,10 @@ chdir = /home/sage/ceph/src restart on core dump = false user = sage - pre start command = "cp /home/sage/ceph/src/c$type /tmp/c$type.`date +%Y%m%d.%H%M%S`" +; pre start command = "cp /home/sage/ceph/src/c$type /tmp/c$type.`date +%Y%m%d.%H%M%S`" + copy executable to = "/tmp/c$type.`date +%Y%m%d.%H%M%S`" + post start command = "echo 0x7f > /proc/\`pgrep c$type | head -1\`/coredump_filter" + ; --------------------- [mon] diff --git a/src/init-ceph.in b/src/init-ceph.in index 7f384a8c13f..6befdb3ccc4 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -160,7 +160,17 @@ for name in $what; do check_host || continue - cmd="$BINDIR/c$type -i $id" + # binary? + binary="$BINDIR/c$type" + if [ "$command" = "start" ]; then + get_conf copy_executable_to "" "copy executable to" + if [ -n "$copy_executable_to" ]; then + scp $binary "$host:$copy_executable_to" + binary="$copy_executable_to" + fi + fi + + cmd="$binary -i $id" # conf file if [ "$host" = "$hostname" ]; then