This commit is contained in:
Quentin Garnier 2015-01-09 16:46:52 +01:00
parent 5971bc54be
commit 4d8e8cf8f4

View File

@ -16,6 +16,7 @@ servicename=$(basename "$0")
OPTIONS="" OPTIONS=""
user=root user=root
timeout=60 timeout=60
start_timeout=5
pidfile=/var/run/centreon_esxd.pid pidfile=/var/run/centreon_esxd.pid
@ -52,12 +53,27 @@ start() {
else else
daemon --user $user ''$binary' '$OPTIONS' > /dev/null 2>&1 &' daemon --user $user ''$binary' '$OPTIONS' > /dev/null 2>&1 &'
fi fi
sleep 2
i=0
while : ; do
if [ "$i" -gt $start_timeout ] ; then
failure $"service not launched"
echo
return 1
fi
pid=$(pidofproc $binary) pid=$(pidofproc $binary)
RETVAL=$? if [ -n "$pid" ] ; then
echo $pid > $pidfile echo $pid > $pidfile
break
fi
sleep 1
i=$(($i + 1))
done
success $"service launched" success $"service launched"
echo echo
return $RETVAL return 0
} }
stop() { stop() {