Skip to content
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
7 changes: 7 additions & 0 deletions docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion internal/box/scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
Loading