Skip to content

Fix: Write FRR device log to /var/log/frr instead of /tmp/logging#3479

Merged
ipspace merged 1 commit into
ipspace:devfrom
a-v-popov:worktree-frr-probe
Jun 15, 2026
Merged

Fix: Write FRR device log to /var/log/frr instead of /tmp/logging#3479
ipspace merged 1 commit into
ipspace:devfrom
a-v-popov:worktree-frr-probe

Conversation

@a-v-popov

Copy link
Copy Markdown
Collaborator

On Ubuntu 26.04 AppArmor is enabled by default with bgpd and staticd profiles restricting access to /tmp.
AppArmor policy is global and pathname-based, so the confinement reaches into the container and as result
netlab initial fails on frr:10.4.1, and on frr:10.6.1 logging configuration fails with a warning.

Fix

Log to /var/log/frr/frr.log, FRR's "canonical" log directory, which
abstractions/frr already permits — so no AppArmor change is required.
The stock FRR image ships no /var/log/frr, so the template creates it
(owned by frr) before the daemons open the file. The directory is created
by the unconfined initial shell, not the confined daemon.

Files changed:

  • netsim/ansible/templates/initial/frr.j2 — new log path + mkdir/chown,
    with a Jinja comment recording the AppArmor rationale.
  • docs/caveats.md — the current-state note now cites /var/log/frr/frr.log.

The log path was never a shared contract: a repo-wide sweep found no reader of
the old destination (only the template wrote it). The historical
docs/release/25.09.md note is left untouched, as it correctly records what
25.09 shipped. No release note is added here; release notes in this project are
curated at release time.

Testing

tests/integration/bgp.session/10-timers.yml, device frr, provider clab,
probe pinned to frr:10.4.1 (the previously-fatal version):

  • netlab up now completes initial,bgp,bgp.session on both nodes (the probe
    previously failed initial).
  • netlab validate[SUCCESS] Tests passed: 4 (session_v4, session_v6,
    timers_v4, timers_v6).
  • On the 10.4.1 node, the confined bgpd and staticd daemons now write to
    /var/log/frr/frr.log (BGP and STATIC log lines present); no /tmp/logging
    is created — confirming logging is functional, not merely non-fatal.

The initial template configured `log file /tmp/logging`, but a host that
loads the FRR AppArmor profiles (shipped in Ubuntu's `apparmor` package,
not the `frr` package) confines the `bgpd` and `staticd` binaries by their
`/usr/lib/frr/...` path -- the confinement reaches into the container -- and
those profiles permit `/var/log/frr/*` while denying `/tmp`. On FRR 10.4 the
resulting log-file open failure is fatal and aborts `netlab initial`; on 10.6
it is downgraded to a warning, so the destination silently never worked there
either.

Log to `/var/log/frr/frr.log`, FRR's canonical directory, which the
`abstractions/frr` profile already permits -- so this needs no AppArmor
change. The stock FRR image ships no `/var/log/frr`, so the template creates
it (owned by `frr`) before the daemons open the file; the directory is created
by the unconfined initial shell, not the confined daemon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@ipspace ipspace left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a million!

@ipspace ipspace merged commit d85643c into ipspace:dev Jun 15, 2026
@a-v-popov a-v-popov deleted the worktree-frr-probe branch June 19, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants