mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
init-ceph: do not stop start on first failure
When starting we often loop over many daemon instances. Currently we stop on the first error and do not try to start other daemons. Instead, try them all, but return a failure if anything did not start. Fixes: #2545 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
This commit is contained in:
parent
be4807f5b8
commit
d395aa521e
@ -99,6 +99,24 @@ do_cmd() {
|
||||
fi
|
||||
}
|
||||
|
||||
do_cmd_okfail() {
|
||||
ERR=0
|
||||
if [ -z "$ssh" ]; then
|
||||
[ $verbose -eq 1 ] && echo "--- $host# $1"
|
||||
ulimit -c unlimited
|
||||
whoami=`whoami`
|
||||
if [ "$whoami" = "$user" ] || [ -z "$user" ]; then
|
||||
bash -c "$1" || { [ -z "$3" ] && echo "failed: '$1'" && ERR=1 && return 1; }
|
||||
else
|
||||
sudo su $user -c "$1" || { [ -z "$3" ] && echo "failed: '$1'" && ERR=1 && return 1; }
|
||||
fi
|
||||
else
|
||||
[ $verbose -eq 1 ] && echo "--- $ssh $2 \"if [ ! -d $sshdir ]; then mkdir -p $sshdir; fi; cd $sshdir ; ulimit -c unlimited ; $1\""
|
||||
$ssh $2 "if [ ! -d $sshdir ]; then mkdir -p $sshdir; fi; cd $sshdir ; ulimit -c unlimited ; $1" || { [ -z "$3" ] && echo "failed: '$ssh $1'" && ERR=1 && return 1; }
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
do_root_cmd() {
|
||||
if [ -z "$ssh" ]; then
|
||||
[ $verbose -eq 1 ] && echo "--- $host# $1"
|
||||
|
@ -320,7 +320,10 @@ for name in $what; do
|
||||
get_conf pre_start "" "pre start command"
|
||||
get_conf post_start "" "post start command"
|
||||
[ -n "$pre_start" ] && do_cmd "$pre_start"
|
||||
do_cmd "$cmd" $runarg
|
||||
do_cmd_okfail "$cmd" $runarg
|
||||
if [ "$ERR" != "0" ]; then
|
||||
EXIT_STATUS=$ERR
|
||||
fi
|
||||
|
||||
if [ "$type" = "mon" ]; then
|
||||
# this will only work if we are using default paths
|
||||
|
Loading…
Reference in New Issue
Block a user