mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
Fix #6411
This commit is contained in:
parent
5971bc54be
commit
4d8e8cf8f4
@ -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
|
||||||
pid=$(pidofproc $binary)
|
|
||||||
RETVAL=$?
|
sleep 2
|
||||||
echo $pid > $pidfile
|
|
||||||
|
i=0
|
||||||
|
while : ; do
|
||||||
|
if [ "$i" -gt $start_timeout ] ; then
|
||||||
|
failure $"service not launched"
|
||||||
|
echo
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
pid=$(pidofproc $binary)
|
||||||
|
if [ -n "$pid" ] ; then
|
||||||
|
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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user