File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ function printError {
5353 echo " $@ " 1>&2
5454}
5555
56+ function waitForPid {
57+ while [ -d /proc/$1 ] ; do
58+ echo " PID $1 still exists"
59+ sleep 10
60+ done
61+ echo " PID $1 is done"
62+ }
63+
64+ JVB_PID=$( ps aux | grep java | grep jitsi-videobridge.jar | awk ' {print $2}' )
65+
5666shutdownStatus=` curl -s -o /dev/null -H " Content-Type: application/json" -d ' { "graceful-shutdown": "true" }' -w " %{http_code}" " $hostUrl /colibri/shutdown" `
5767if [ " $shutdownStatus " == " 200" ]
5868then
6373 sleep 10
6474 participantCount=` getParticipantCount`
6575 if [[ $? -gt 0 ]] ; then
66- printInfo " Failed to get participant count, Bridge already shutdown"
76+ printInfo " Failed to get participant count, bridge may be already shutdown, waiting on pid $JVB_PID "
77+ waitForPid $JVB_PID
6778 exit 0
6879 fi
6980 done
7081
71- echo " Waiting 60 seconds for bridge to finish shutting down"
72- sleep 60
82+ echo " Waiting for bridge pid $JVB_PID to finish shutting down"
83+ waitForPid $JVB_PID
7384 printInfo " Bridge shutdown OK"
7485 exit 0
7586else
You can’t perform that action at this time.
0 commit comments