Skip to content

Commit 6e82388

Browse files
authored
Merge pull request #18 from efrecon/feature/one-removal
Log cleanup
2 parents 343ea9c + eefc44d commit 6e82388

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ sublog() {
206206
verbose "$1 now present on disk"
207207

208208
# Then reroute its content through our logging printf style
209-
tail -n +0 -f "$1" | while IFS= read -r line; do
209+
tail -n +0 -f "$1" 2>/dev/null | while IFS= read -r line; do
210210
if [ -n "$line" ]; then
211211
printf '[%s] [%s] %s\n' \
212212
"${2:-}@${KRUNVM_RUNNER_BIN:-$(basename "$0")}" \

orchestrator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ cleanup() {
9393

9494
for pid in $ORCHESTRATOR_PIDS; do
9595
verbose "Killing runner loop $pid"
96-
kill "$pid"
96+
kill "$pid" 2>/dev/null || true
9797
done
9898
verbose "Waiting for runners to die"
9999
# shellcheck disable=SC2086 # We want to wait for all pids

runner/runner.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ runner_unregister() {
236236
trap - INT TERM EXIT
237237

238238
# Remember or request (again) a runner registration token
239-
verbose "Caught termination signal, unregistering runner"
239+
if [ "${1:-0}" = "1" ]; then
240+
verbose "Caught termination signal/request, unregistering runner"
241+
else
242+
verbose "Caught regular exit signal, unregistering runner"
243+
fi
240244
if [ -n "${RUNNER_PAT:-}" ]; then
241245
if [ -n "${RUNNER_TOKENFILE:-}" ] && [ -f "$RUNNER_TOKENFILE" ]; then
242246
verbose "Reading runner token from $RUNNER_TOKENFILE"

0 commit comments

Comments
 (0)