Skip to content
Open
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
3 changes: 3 additions & 0 deletions dist/systemd/system/zincati.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Description=Zincati Update Agent
Documentation=https://github.com/coreos/zincati
# Skip live systems not meant to be auto-updated (e.g. live PXE, live ISO)
ConditionPathExists=!/run/ostree-live
# This ensures compatibility with `bcvk ephemeral` today; compatibility
# with a bootc+composefs future is still TBD.
ConditionKernelCommandLine=ostree
Comment on lines +6 to +8

Choose a reason for hiding this comment

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

medium

Using ConditionKernelCommandLine=ostree to detect an ostree-based system might not be the most robust method. A key issue is that when running in a container on an ostree host (e.g. via podman run /sbin/init), this condition will be met because it reads the host's kernel command line. This could lead to the agent unexpectedly running inside the container, which is likely not the desired behavior.

A more standard and reliable way to check for an ostree system is ConditionPathExists=/ostree/repo. This is the approach used by other core ostree services like rpm-ostreed.service. It would correctly identify the environment and avoid running inside a container unless the ostree repository is explicitly available.

For better robustness, I recommend using this condition instead.

ConditionPathExists=/ostree/repo

Copy link
Member Author

Choose a reason for hiding this comment

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

Hah, wow it's right. docker/podman not masking the kernel commandline is really a giant footgun in all of this (unlike LXC among others IIRC).

But this isn't a new problem, and really wants a nicer system in general.

A more standard and reliable way to check for an ostree system is ConditionPathExists=/ostree/repo.

Yeah, though in some corner cases this will be wrong, such as having co-installed bootc/ostree alongside a package system and doing a rollback.

I guess we probably do need a consistent /run/bootc-booted or so that's always set even in the bootc+composefs case.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a consensus on the path forward?

Copy link
Member Author

Choose a reason for hiding this comment

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

Merge this as is and we'll come back to the composefs problem later.

Copy link
Member

Choose a reason for hiding this comment

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

specifically for podman run /sbin/init (not sure about bcvk) would ConditionVirtualization=!container work?

After=network.target
# Wait for the boot to be marked as successful. In cluster contexts,
# this prevents rolling out broken updates to all nodes in the fleet.
Expand Down
Loading