fix: units an unprivileged container cannot run stay off there #34
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/common!34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/container-units"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On a Keel Web LXC container on Proxmox (keel-core 19.0-6, 2026-10-03),
systemctl --failedlisted systemd-networkd-wait-online.service, sys-kernel-config.mount and sys-kernel-debug.mount, and ntpsec logged "ntp_adjtime: Operation not permitted" every few minutes.Cause of each
After=network-online.target, which ifupdown's networking.service reaches);keel inspectreports network.managed_by host or file.ConditionCapability=CAP_SYS_RAWIO, which passes inside a user namespace because the container init's bounding set is full there; the kernel then refuses the mount, since debugfs and configfs cannot be mounted outside the initial user namespace.ConditionCapability=CAP_SYS_TIMEpasses,adjtimexis refused outside the initial user namespace, so ntpd runs and fails every adjustment.Change
conf/turnkey.d/container-unitsdisables systemd-networkd.service, systemd-networkd.socket and systemd-networkd-wait-online.service, and writeskeel-container.confwithConditionVirtualization=!container(systemd.unit(5), systemd 257 of trixie) as a drop-in of ntpsec.service, sys-kernel-config.mount and sys-kernel-debug.mount. In a container the three stay inactive with the condition unmet; on a VM or a bare install they run as before. Nothing is masked, no package is removed. ntpsec is the only time daemon the plans install (desktop's ntpdate is a one-shot).Tests
tests/container-units.bats: the script against the systemctl stub and a scratch systemd tree, with trixie's packaged units as fixtures; systemd-analyze gives the verdict on the condition and on the merged units. 100 percent of the script's lines (tests/coverage.sh at 100).tests/container-units-live.bats, run last by the CI job install in its booted trixie LXC container with ntpsec installed: applies the script to the machine, then reads back that networkd is disabled, that systemd loaded the drop-ins and skips each unit onsystemctl start, and that starting them adds nothing tosystemctl --failed --no-legend: no unit of this change in it and no new one. The CI container is not rebooted, so this is after a start of the units, not after a boot; and it has mounts of its own failing at boot (dev-mqueue, run-lock, tmp: keel-lxc-1's AppArmor profile lets it mount nothing), so the suite cannot ask for an empty list there, only the image on Proxmox can show that.Changelog bullet in the unreleased turnkey-core-19.0 (1) entry; COVERAGE.md section.