-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
37 lines (32 loc) · 705 Bytes
/
run.sh
File metadata and controls
37 lines (32 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
java -Xms10g -Xmx16g -cp scheduler.jar:/app/grpc-core-1.56.0.jar org.aliyun.serverless.Application &
echo "Scaler is starting..."
SCALER_PID=$!
while true; do
nc -z localhost 9001 > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Scaler is now available."
break
else
sleep 1
fi
done
while true; do
nc -z localhost 9000 > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Simulator is now available."
break
else
sleep 1
fi
done
while true; do
nc -z localhost 9000 > /dev/null 2>&1
if [ $? -eq 0 ]; then
sleep 1
else
echo "Simulator(:9000) has stopped, stopping the Scaler process..."
kill $SCALER_PID
exit 0
fi
done