Log FRR container output to docker logs#3541
Merged
Merged
Conversation
ipspace
requested changes
Jun 30, 2026
ipspace
left a comment
Owner
There was a problem hiding this comment.
I guess there's not much harm in doing this, so let's do it (with a few safeguards ;)
| # Redirect FRR's log to the container's stdout so 'docker logs' works | ||
| # | ||
| FRR_LOG_OUTPUT="/proc/$(pgrep -f '^/bin/bash /usr/lib/frr/docker-start$')/fd/1" | ||
| touch /var/log/frr/frr.log && chown frr:frr /var/log/frr/frr.log |
Owner
There was a problem hiding this comment.
Move the whole block after FRR configuration is already done, and you won't need this
| # | ||
| FRR_LOG_OUTPUT="/proc/$(pgrep -f '^/bin/bash /usr/lib/frr/docker-start$')/fd/1" | ||
| touch /var/log/frr/frr.log && chown frr:frr /var/log/frr/frr.log | ||
| tail -n 0 -F /var/log/frr/frr.log >${FRR_LOG_OUTPUT} 2>&1 & |
Owner
There was a problem hiding this comment.
You sure you don't need 'nohup' here?
Also, execute this at the very end of the initial configuration, preceded by set +e, so we won't get configuration errors if this concoction crashes.
Collaborator
Author
There was a problem hiding this comment.
I left out the set +e, after removing the touch it's only a tail. I checked that nohup is not needed (bash has huponexit disabled by default)
Relay FRR file logging to the container stdout stream for clab nodes while keeping the regular file target for other providers. Co-authored-by: Cursor <cursoragent@cursor.com>
Use frr.logfile consistently, run tail after vtysh initial config, and forward to PID 1 stdout so docker logs captures FRR output. Co-authored-by: Cursor <cursoragent@cursor.com>
FRR creates the log file when logging is enabled; tail can follow it directly. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relay FRR file logging to the container stdout stream for clab Docker nodes, enabling debugging when
frr.debugis setSample use case:
With this PR,
docker logs clab-bgpsession-dutshows the BFD events working for 10.6.1 but failing for 10.5.1