From 4c9dcc111b105d6866dc44d497e37cb03eff1dd7 Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Mon, 24 Apr 2023 17:55:23 -0400 Subject: [PATCH] log file added --- release_version.txt | 2 +- scripts/config_server_start.sh | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/release_version.txt b/release_version.txt index bbdeab6..1750564 100644 --- a/release_version.txt +++ b/release_version.txt @@ -1 +1 @@ -0.0.5 +0.0.6 diff --git a/scripts/config_server_start.sh b/scripts/config_server_start.sh index 41702ba..2f6cbc5 100755 --- a/scripts/config_server_start.sh +++ b/scripts/config_server_start.sh @@ -57,39 +57,26 @@ Cmd="${Cmd} python3" Cmd="${Cmd} ${ServerPy}" Cmd="${Cmd} --port=${ServicePort}" Cmd="${Cmd} --root=${ServiceDir}" +Cmd="${Cmd} --log_file=${LogDir}/%T.config_service.log" +function start_it { + echo ${Cmd} + eval ${Cmd} & + sleep 10 +} function check_it { if !(timeout 3 curl -s localhost:${AdminPort}/ping > /dev/null) then echo "${Script} doesn't respond. restarting..." + start_app pids=$(ps -ef | grep "port=${ServicePort}" | grep "root=${ServiceDir}" | grep -v grep | tr -s ' ' |cut -d' ' -f2) echo pids=${pids} if [ "${pids}" != "" ] then kill -9 ${pids} fi - echo ${Cmd} - eval ${Cmd} && sleep 10 - fi -} - -function start_it { - if !(timeout 3 curl -s localhost:${AdminPort}/ping > /dev/null) - then - pids=$(ps -ef |grep $(basename ${0}) |grep -v ${$} |grep -v grep |tr -s ' ' |cut -d' ' -f2) - if [ "${pids}" != "" ] - then - echo "${0} is already running. pids=(${pids}). Use --restart" - exit 0 - fi - echo pids=${pids} - if [ "${pids}" != "" ] - then - kill -9 ${pids} - fi - echo ${Cmd} - eval ${Cmd} && sleep 10 + start_it fi }