From 8d2e8dcbbde3fdaf5472ee56adfcedb007ac714e Mon Sep 17 00:00:00 2001 From: Bailey Pumfleet Date: Thu, 15 Oct 2026 07:37:20 -0500 Subject: [PATCH] fix(box): new terminals no longer open with a systemd CPUAccounting warning systemd 258 and later deprecate CPUAccounting= (cgroup v2 always counts CPU time), and systemd-run printed "D-Bus property CPUAccounting is deprecated" into every new pane, --quiet or not. Session scopes no longer ask for it; cpu.stat's usage_usec is there without it. Co-Authored-By: Claude Opus 5.5 --- docs/changelog.mdx | 7 +++++++ internal/box/scopes.go | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/changelog.mdx b/docs/changelog.mdx index e7fefed8..c440be01 100644 --- a/docs/changelog.mdx +++ b/docs/changelog.mdx @@ -9,6 +9,13 @@ upgrades with `berth upgrade BOX`, or by running the [install command](/getting-started/add-a-box#with-the-install-command) again. +## Unreleased + +- **New terminals no longer open with a systemd warning.** On boxes with + systemd 258 or later, every new tab started with *D-Bus property + CPUAccounting is deprecated*. Sessions still report their CPU use as + before. Needs the box upgraded. + ## v0.3.21 - **The phone app pairs from a pasted link.** Its Pair and Boxes screens have diff --git a/internal/box/scopes.go b/internal/box/scopes.go index 59bce44a..c737f14a 100644 --- a/internal/box/scopes.go +++ b/internal/box/scopes.go @@ -103,13 +103,16 @@ func (s *systemdScopes) Available(ctx context.Context) bool { return s.ok } +// Wrap asks for no CPUAccounting: cgroup v2 always counts a scope's CPU +// time (cpu.stat's usage_usec), and systemd 258 and later print a warning +// for it in every new pane. func (s *systemdScopes) Wrap(unit, description string, memoryHigh uint64) []string { run := s.run if run == "" { run = "systemd-run" } args := []string{run, "--user", "--scope", "--quiet", "--collect", "--unit=" + unit, "--description=" + description, - "-p", "TimeoutStopSec=" + scopeTimeoutStop, "-p", "CPUAccounting=yes", "-p", "MemoryAccounting=yes"} + "-p", "TimeoutStopSec=" + scopeTimeoutStop, "-p", "MemoryAccounting=yes"} if memoryHigh > 0 { args = append(args, "-p", "MemoryHigh="+strconv.FormatUint(memoryHigh, 10)) }