Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log cleanup #18

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ sublog() {
verbose "$1 now present on disk"

# Then reroute its content through our logging printf style
tail -n +0 -f "$1" | while IFS= read -r line; do
tail -n +0 -f "$1" 2>/dev/null | while IFS= read -r line; do
if [ -n "$line" ]; then
printf '[%s] [%s] %s\n' \
"${2:-}@${KRUNVM_RUNNER_BIN:-$(basename "$0")}" \
Expand Down
2 changes: 1 addition & 1 deletion orchestrator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ cleanup() {

for pid in $ORCHESTRATOR_PIDS; do
verbose "Killing runner loop $pid"
kill "$pid"
kill "$pid" 2>/dev/null || true
done
verbose "Waiting for runners to die"
# shellcheck disable=SC2086 # We want to wait for all pids
Expand Down
6 changes: 5 additions & 1 deletion runner/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ runner_unregister() {
trap - INT TERM EXIT

# Remember or request (again) a runner registration token
verbose "Caught termination signal, unregistering runner"
if [ "${1:-0}" = "1" ]; then
verbose "Caught termination signal/request, unregistering runner"
else
verbose "Caught regular exit signal, unregistering runner"
fi
if [ -n "${RUNNER_PAT:-}" ]; then
if [ -n "${RUNNER_TOKENFILE:-}" ] && [ -f "$RUNNER_TOKENFILE" ]; then
verbose "Reading runner token from $RUNNER_TOKENFILE"
Expand Down
Loading