mirror of
https://github.com/kasmtech/workspaces-core-images.git
synced 2025-06-26 06:51:45 +02: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
|
if [[ -f "$kasm_recorder_ack" ]]; then
|
||||||
local ack_user=$(stat -c '%U' $kasm_recorder_ack)
|
local ack_user=$(stat -c '%U' $kasm_recorder_ack)
|
||||||
if [[ "$ack_user" == "kasm-recorder" ]]; then
|
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=""
|
kasm_recorder_pid=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local recorder_pid=$(pgrep -f "^$kasm_recorder_process") || true
|
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 $kasm_recorder_pid ]]; then
|
||||||
if [[ -z $recorder_pid ]] && (( $SECONDS > 15 )); then
|
if [[ -z $recorder_pid ]] && (( $SECONDS > 15 )); then
|
||||||
echo "$kasm_recorder_process: not started, exiting"
|
echo "$kasm_recorder_process: not started, exiting"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user