]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crun: restart only processes that should have dumped core
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 30 Jan 2009 20:45:31 +0000 (12:45 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 30 Jan 2009 20:46:17 +0000 (12:46 -0800)
src/crun

index 100174b0adab12b3927c03cc2b5fe4c14565e2a2..8cbd283c508f69ba67750918ca80adb175bbb994 100755 (executable)
--- a/src/crun
+++ b/src/crun
@@ -41,10 +41,25 @@ while [ $# -ge 1 ]; do
        shift
 done
 
+core_sig[11]=1
+core_sig[3]=1
+core_sig[4]=1
+core_sig[5]=1
+core_sig[6]=1
+core_sig[8]=1
+
+
 get_conf_bool do_ulimit 0 "ulimit core" crun global
 [ "$do_ulimit" != "0" ] && ulimit -c unlimited
 
 while [ true ]; do
        $valgrind $orig_args
+       exit_code=$?
        [ $daemon -eq 1 ] && exit
+
+       if [ $exit_code -gt 128 ]; then
+               [ "${core_sig[$(($exit_code-128))]}" != "1" ] && exit
+       else
+               exit
+       fi
 done