Skip to content

Support path-triggering when using composefs backend #2119

Open

Description

@jeckersb

We have a collection of systemd units that trigger on modification of /ostree/bootc today when using the ostree backend. Most notably this triggers rhsm facts generation whenever deployments are changed, either while modifying a running system or when the deployments change during boot (booted becomes rollback, staged becomes booted).

We don't handle that at all with the composefs backend currently, so we'll need to (1) add the code in the right place to update the mtime on the composefs storage root, and (2) update the systemd unit(s), I am pretty sure this is simply adding an extra PathChanged line to the .path unit and everything else should continue functioning the same.

Activity

  1. self-assigned this
    on Apr 2, 2026
  2. cgwalters commented on Apr 6, 2026

    @cgwalters
    Member

    Sounds reasonable to me though another idea here - what if we just always initialize a composefs repo - even if empty - and change its mtime when we make changes too?

  3. jeckersb commented on Apr 7, 2026

    @jeckersb
    CollaboratorAuthor

    I think the thing we need to be careful about is avoiding a situation where (1) we have both ostree and composefs repos present, (2) we update the mtime code to always update both, and (3) we have the path unit watching both. I am assuming that would end up firing the path unit twice and that's just asking for things to race and go wrong.

  4. cgwalters commented on Apr 7, 2026

    @cgwalters
    Member

    It makes sense to optimize but consumers already have to be ready for successive changes, right? I don't think it can race - the path unit acts as a serialization point, we aren't spawning mulitple things at once.

  5. jeckersb commented on Apr 7, 2026

    @jeckersb
    CollaboratorAuthor

    It makes sense to optimize but consumers already have to be ready for successive changes, right? I don't think it can race - the path unit acts as a serialization point, we aren't spawning mulitple things at once.

    Yeah you're right, I tested it and it only triggers once:

    jeckersb@burd:/var/tmp$ journalctl --user -f -u bootc-status-modified.target &
    [1] 102617
    jeckersb@burd:/var/tmp$ systemctl --user start bootc-status-modified.path
    jeckersb@burd:/var/tmp$ systemctl --user status bootc-status-modified.path
    ● bootc-status-modified.path - Monitor bootc for status changes
         Loaded: loaded (/var/home/jeckersb/.config/systemd/user/bootc-status-modified.path; disabled; preset: disabled)
         Active: active (waiting) since Tue 2026-04-07 16:23:11 EDT; 16s ago
     Invocation: d749fe36a2d444beb6e2cc6d691d6ecd
       Triggers: ● bootc-status-modified.target
    
    Apr 07 16:23:11 burd systemd[3086]: Started bootc-status-modified.path - Monitor bootc for status changes.
    jeckersb@burd:/var/tmp$ cat ~/.config/systemd/user/bootc-status-modified.path
    [Unit]
    Description=Monitor bootc for status changes
    
    [Path]
    PathChanged=/var/tmp/path-test-a
    PathChanged=/var/tmp/path-test-b
    Unit=bootc-status-modified.target
    
    [Install]
    WantedBy=multi-user.target
    jeckersb@burd:/var/tmp$ touch /var/tmp/path-test-a /var/tmp/path-test-b
    jeckersb@burd:/var/tmp$ Apr 07 16:23:50 burd systemd[3086]: Reached target bootc-status-modified.target - Target for bootc status changes.
    Apr 07 16:23:50 burd systemd[3086]: Stopped target bootc-status-modified.target - Target for bootc status changes.
    
    jeckersb@burd:/var/tmp$ touch /var/tmp/path-test-a /var/tmp/path-test-b
    jeckersb@burd:/var/tmp$ Apr 07 16:24:01 burd systemd[3086]: Reached target bootc-status-modified.target - Target for bootc status changes.
    Apr 07 16:24:01 burd systemd[3086]: Stopped target bootc-status-modified.target - Target for bootc status changes.
    
  6. jeckersb commented on Apr 7, 2026

    @jeckersb
    CollaboratorAuthor

    One issue I'm seeing with always creating the composefs repo is that we need to make the determination of whether to require verity in said repo. Currently the composefs backend does that with --allow-missing-verity but that is a composefs-install-time option. If we're operating on an ostree-only system, either during a fresh install or on an existing system (for upgrade purposes we probably want to check and create the composefs repo on other mutating operations like upgrade), it's not obvious to me how we should handle that.

  7. cgwalters commented on Apr 7, 2026

    @cgwalters
    Member

    I think detect if fsverity is supported, if so we opt in to enabling it by default?

    --allow-missing-verity we discussed extensively IIRC in another PR and I think it wasn't useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions