]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph: optionally copy executable to remote host before running it
authorSage Weil <sage@newdream.net>
Thu, 3 Dec 2009 00:08:44 +0000 (16:08 -0800)
committerSage Weil <sage@newdream.net>
Fri, 4 Dec 2009 00:21:10 +0000 (16:21 -0800)
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.

src/ceph.conf.sepia
src/init-ceph.in

index 13da83f1da8744cbaa1d210ccf79b2a542196293..877d56b8b5a9b6baf3d225c4a2f4124e80e0ab68 100644 (file)
        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]
index 7f384a8c13f960e5068c129d4fc1dd1e861bb167..6befdb3ccc4ef76e82e9038928cf8b0f7d06628c 100644 (file)
@@ -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