mirror of
https://github.com/kasmtech/workspaces-core-images.git
synced 2024-11-24 16:33:19 +01:00
KASM-5378 Add while loop to wait the 15 seconds
This commit is contained in:
parent
5c8e3b9e92
commit
2892f64b84
@ -324,13 +324,19 @@ function ensure_recorder_running () {
|
||||
if [[ -f "$kasm_recorder_ack" ]]; then
|
||||
local ack_user=$(stat -c '%U' $kasm_recorder_ack)
|
||||
if [[ "$ack_user" == "kasm-recorder" ]]; then
|
||||
SECONDS=0
|
||||
SECONDS=0 #SECONDS is a built in bash variable that is incremented approximately every second
|
||||
kasm_recorder_pid=""
|
||||
fi
|
||||
fi
|
||||
|
||||
local recorder_pid=$(pgrep -f "^$kasm_recorder_process") || true
|
||||
|
||||
while [ $SECONDS -lt 16 ] && [[ -z $recorder_pid ]]
|
||||
do
|
||||
local recorder_pid=$(pgrep -f "^$kasm_recorder_process") || true
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [[ -z $kasm_recorder_pid ]]; then
|
||||
if [[ -z $recorder_pid ]] && (( $SECONDS > 15 )); then
|
||||
echo "$kasm_recorder_process: not started, exiting"
|
||||
|
Loading…
Reference in New Issue
Block a user