ceph/src/crun

66 lines
1.0 KiB
Plaintext
Raw Normal View History

2008-10-03 19:06:28 +00:00
#!/bin/sh
2009-01-29 23:01:25 +00:00
SCRIPT_BIN=`dirname $0`
2009-01-30 19:41:06 +00:00
. $SCRIPT_BIN/ceph_common.sh
2009-01-29 23:01:25 +00:00
2008-11-03 20:35:40 +00:00
daemon=0
valgrind=""
# explicit -n/--norestart?
while [ $# -ge 1 ]; do
case $1 in
-n | --norestart )
daemon=1
shift
;;
--valgrind )
valgrind="valgrind"
daemon=1
shift
;;
2009-01-29 23:01:25 +00:00
--conf_file )
startup_conf_file=$2
shift
;;
* )
break
esac
done
2009-01-29 23:01:25 +00:00
[ "$startup_conf_file" == "" ] && startup_conf_file="startup.conf"
CCONF="$CCONF_BIN --conf_file $startup_conf_file"
orig_args=$*
# implicit from any -d?
while [ $# -ge 1 ]; do
case $1 in
-d | --daemon )
daemon=1
esac
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
2009-01-29 23:01:25 +00:00
get_conf_bool do_ulimit 0 "ulimit core" crun global
[ "$do_ulimit" != "0" ] && ulimit -c unlimited
2008-10-03 19:06:28 +00:00
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
2008-10-03 19:06:28 +00:00
done