1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
# corosync - Corosync Cluster Engine
#
# Starts corosync
expect fork
env prog=corosync
env sysconf=@CONFIGDIR@/corosync
script
[ -f "$sysconf" ] && . $sysconf
exec $prog $COROSYNC_OPTIONS
end script
pre-start script
mkdir -p @localstatedir@/run
end script
post-start script
wait_for_ipc()
{
[ -f "$sysconf" ] && . $sysconf
try=0
max_try=$((COROSYNC_INIT_TIMEOUT*2-1))
[ "$max_try" -le "0" ] && max_try=120
while [ "$try" -le "$max_try" ]; do
if corosync-cfgtool -s > /dev/null 2>&1; then
return 0
fi
sleep 0.5
try=$((try + 1))
done
logger -i -t "$UPSTART_JOB" "ERROR: Any interfaces are faulty!"
return 1
}
wait_for_ipc || { stop; exit 1; }
end script
|