osmith has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/41721?usp=email )
Change subject: common/respawn: improve logging ......................................................................
common/respawn: improve logging
Add "[$(date)] respawn:" infront of all log messages, so it is clear that they come from this script and so we have timestamps that we can compare. This will be useful when running the bpftrace scripts along with osmo-bts-*, which will get restarted at the same time as the osmo-bts-* processes.
Change-Id: I641f17f6988eced12c9b301042fb5c5cfd757511 --- M common/respawn.sh 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/common/respawn.sh b/common/respawn.sh index d9bf641..1040408 100755 --- a/common/respawn.sh +++ b/common/respawn.sh @@ -7,15 +7,15 @@ i=0 max_i=500 while [ $i -lt $max_i ]; do - echo "respawn: $i: starting: $*" + echo "[$(date)] respawn: $i: starting: $*" $* & LAST_PID=$! wait $LAST_PID - echo "$i: stopped pid $LAST_PID with status $?" + echo "[$(date)] respawn: $i: stopped pid $LAST_PID with status $?" if [ $SLEEP_BEFORE_RESPAWN -gt 0 ]; then - echo "sleeping $SLEEP_BEFORE_RESPAWN seconds..." + echo "[$(date)] respawn: sleeping $SLEEP_BEFORE_RESPAWN seconds..." sleep $SLEEP_BEFORE_RESPAWN fi i=$(expr $i + 1) done -echo "exiting after $max_i runs" +echo "[$(date)] respawn: exiting after $max_i runs"