improve python daemons start

This commit is contained in:
Eugenio Marzo
2023-02-01 22:24:04 +01:00
parent 044a637522
commit 7c33d04f83
2 changed files with 3 additions and 5 deletions
+1 -2
View File
@@ -13,7 +13,6 @@ python3 /opt/logs_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_
while true
do
( ps -ef | grep start.py | grep logs_loop | grep -v grep &> /dev/null) || echo "Error. Logs Loop is down..."
( ps -ef | grep start.py | grep logs_loop | grep -v grep &> /dev/null) || ( python3 /opt/logs_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS} & )
pgrep -a -f -c "^python3.*logs_loop.*$" > /dev/null || ( python3 /opt/logs_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS} & )
sleep 2
done
+2 -3
View File
@@ -12,7 +12,6 @@ python3 /opt/metrics_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNET
while true
do
( ps -ef | grep start.py | grep metrics_loop | grep -v grep &> /dev/null) || echo "Error. Metrics Loop is down..."
( ps -ef | grep start.py | grep metrics_loop | grep -v grep &> /dev/null) || (python3 /opt/metrics_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS} & )
pgrep -a -f -c "^python3.*metrics_loop.*$" > /dev/null || ( python3 /opt/metrics_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS} & )
sleep 2
done
done