← Back to Pull requests

Empty /var/tmp on shutdown and reboot #28

Open
unknown opened this pull request with 252 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 25, 2026 11:49 UTC
Author

/tmp is /var/tmp on disk (#27), so unlike a tmpfs it survives a reboot. This adds agenticlinux-clean-var-tmp.service, whose ExecStop empties it.

  • systemd-tmpfiles --remove, not find or rm -rf /var/tmp/*. From a plain unit those run as SELinux's init_t, which has no rule to remove symlinks (or fifos in user_tmp_t) in /tmp. find -xdev also follows a same-filesystem bind mount into its source (Copilot's review, reproduced: the old command emptied the mount's source, the new unit leaves it alone).

  • Ordering: Before=sysinit.target plus the bootguard arm and finalizer units, so it stops after everything that uses /tmp. bootc writes there at shutdown.

  • Config is usr/lib/agenticlinux/clean-var-tmp.conf, not tmpfiles.d, which is also read at boot and could empty /tmp under a unit already using it.

  • Smoke test: stops the unit in the VM and checks a nested tree, dotfile, symlink and fifo are gone and the mode is kept.
  • Main's failing builds

    The aarch64 base and sway smoke tests failed with every openclaw turn timing out. The model's first call was the computer tool (key OK). It needs a Gateway that agent --local does not start, so it errored the same way for 30 minutes, three attempts running. The smoke test now seeds tools.deny: ["group:nodes"] (nodes, computer, mobile_ui), which onboarding keeps.

    Testing

    Fedora 44 container, systemd 259 as PID 1: a real poweroff ran after two slow-stopping stand-ins for an ordinary service and the arm step, which still saw their files, then /var/tmp was empty at mode 1777. openclaw 2026.10.5 validates the config, onboarding keeps it, and 12 turns completed with and without it.

    Not tested: the loop itself (it did not reproduce locally), the qemu smoke test, and SELinux enforcement (checked against Fedora's policy with sesearch). Build runs only on main.

    Cleanup is skipped after a crash or power loss, and the default 90s stop timeout cuts a huge /var/tmp short.

    Diff: 252 lines (+189 / -63) across 3 files Reviewer: ericcurtin Review duration: 68m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.44) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 252 lines diff across 3 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.331
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #28"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44% (MEDIUM) · Higher = larger blast radius
    44%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23.5% · Safe to merge
    23.5%