osmith submitted this change.

View Change

Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
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(-)

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"

To view, visit change 41721. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I641f17f6988eced12c9b301042fb5c5cfd757511
Gerrit-Change-Number: 41721
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>