Systemd services assume presence of /run/ostree-booted which causes issues on the composefs backend #133

Closed
opened 2026-09-17 22:53:18 +00:00 by renner · 7 comments

Currently there are a couple services which only run when /run/ostree-booted exists, this file does not exist on the composefs backend. Downstream projects are starting to build images (derived from https://gitlab.com/fedora/ostree/ci-test) using the composefs backend. It would be nice if we could accommodate this use case here.

I think we should keep the existing check for /run/ostree-booted and add ConditionKernelCommandLine=composefs some other check so the presence of either of them allows the service to trigger on images using the composefs and ostree backend.

EDIT: after reading https://github.com/bootc-dev/bootc/pull/2437#discussion_r4051058800, I guess we should rather wait for bootc to make a decision on what to check for explicitly

Here are the 3 services it would affect:

common.yaml-    cat > /usr/lib/systemd/system/fedora-atomic-desktop-appstream-cache-refresh.service << 'EOF'
common.yaml-    [Unit]
common.yaml-    Description=Workaround for Atomic Destkops to refresh the appstream cache
common.yaml-    Documentation=https://gitlab.com/fedora/ostree/sig/-/work_items/103
common.yaml-    ConditionPathIsReadWrite=/var
common.yaml:    ConditionPathExists=/run/ostree-booted
common.yaml-    After=local-fs.target
common.yaml-
common.yaml-    [Service]
common.yaml-    Type=oneshot
common.yaml-    RemainAfterExit=yes
--
common.yaml-    cat > /usr/lib/systemd/system/fedora-atomic-desktop-mandb-update.service << 'EOF'
common.yaml-    [Unit]
common.yaml-    Description=Workaround for Atomic Destkops to update mandb cache
common.yaml-    Documentation=https://gitlab.com/fedora/ostree/sig/-/work_items/62
common.yaml-    ConditionPathIsReadWrite=/var
common.yaml:    ConditionPathExists=/run/ostree-booted
common.yaml-    After=local-fs.target
common.yaml-
common.yaml-    [Service]
common.yaml-    Type=oneshot
common.yaml-    RemainAfterExit=yes
--
kinoite-shared.yaml-    cat > /usr/lib/systemd/system/fedora-kinoite-plasmalogin-workaround.service << 'EOF'
kinoite-shared.yaml-    [Unit]
kinoite-shared.yaml-    Description=Workaround for missing plasmalogin entries in /etc/shadow & /etc/gshadow on Kinoite
kinoite-shared.yaml-    Documentation=https://forge.fedoraproject.org/kde/SIG/issues/684
kinoite-shared.yaml-    ConditionPathIsReadWrite=/etc
kinoite-shared.yaml:    ConditionPathExists=/run/ostree-booted
kinoite-shared.yaml-    ConditionPathExists=!/etc/.fedora-kinoite-plasmalogin-workaround
kinoite-shared.yaml-    Before=plasmalogin.service
kinoite-shared.yaml-
kinoite-shared.yaml-    [Service]
kinoite-shared.yaml-    Type=oneshot
Currently there are a couple services which only run when `/run/ostree-booted` exists, this file does not exist on the composefs backend. Downstream projects are starting to build images (derived from https://gitlab.com/fedora/ostree/ci-test) using the composefs backend. It would be nice if we could accommodate this use case here. I think we should keep the existing check for `/run/ostree-booted` ~~and add `ConditionKernelCommandLine=composefs`~~ some other check so the presence of either of them allows the service to trigger on images using the composefs and ostree backend. EDIT: after reading https://github.com/bootc-dev/bootc/pull/2437#discussion_r4051058800, I guess we should rather wait for bootc to make a decision on what to check for explicitly Here are the 3 services it would affect: ``` common.yaml- cat > /usr/lib/systemd/system/fedora-atomic-desktop-appstream-cache-refresh.service << 'EOF' common.yaml- [Unit] common.yaml- Description=Workaround for Atomic Destkops to refresh the appstream cache common.yaml- Documentation=https://gitlab.com/fedora/ostree/sig/-/work_items/103 common.yaml- ConditionPathIsReadWrite=/var common.yaml: ConditionPathExists=/run/ostree-booted common.yaml- After=local-fs.target common.yaml- common.yaml- [Service] common.yaml- Type=oneshot common.yaml- RemainAfterExit=yes -- common.yaml- cat > /usr/lib/systemd/system/fedora-atomic-desktop-mandb-update.service << 'EOF' common.yaml- [Unit] common.yaml- Description=Workaround for Atomic Destkops to update mandb cache common.yaml- Documentation=https://gitlab.com/fedora/ostree/sig/-/work_items/62 common.yaml- ConditionPathIsReadWrite=/var common.yaml: ConditionPathExists=/run/ostree-booted common.yaml- After=local-fs.target common.yaml- common.yaml- [Service] common.yaml- Type=oneshot common.yaml- RemainAfterExit=yes -- kinoite-shared.yaml- cat > /usr/lib/systemd/system/fedora-kinoite-plasmalogin-workaround.service << 'EOF' kinoite-shared.yaml- [Unit] kinoite-shared.yaml- Description=Workaround for missing plasmalogin entries in /etc/shadow & /etc/gshadow on Kinoite kinoite-shared.yaml- Documentation=https://forge.fedoraproject.org/kde/SIG/issues/684 kinoite-shared.yaml- ConditionPathIsReadWrite=/etc kinoite-shared.yaml: ConditionPathExists=/run/ostree-booted kinoite-shared.yaml- ConditionPathExists=!/etc/.fedora-kinoite-plasmalogin-workaround kinoite-shared.yaml- Before=plasmalogin.service kinoite-shared.yaml- kinoite-shared.yaml- [Service] kinoite-shared.yaml- Type=oneshot ```
Owner

We can probably remove this condition from all those units as they are only defined here and thus only included in our images and it should be safe to run those in all cases.

We can probably remove this condition from all those units as they are only defined here and thus only included in our images and it should be safe to run those in all cases.
Owner

@renner Would you be OK making a PR for that?

@renner Would you be OK making a PR for that?
Author

We can probably remove this condition from all those units as they are only defined here and thus only included in our images and it should be safe to run those in all cases.

One point that speaks against this that I can think of would be on live installation mediums downstream for Bazzite/Bluefin/Aurora at least, which are generated from the regular container images but are not booted with ostree/bootc with composefs backend, so they do still contain the services from here that are only supposed to trigger on the real booted system.

I'm not up-to-date on the behavior/state of generic bootc image builder created ISOs or official Fedora Atomic Desktops ones.

Removing the check now would mean that those who rely on them not firing off in certain scenarios could potentially break/change things in unexpected ways (I don't think anything bad would happen on those listed here though). It's not a big issue as it would be an easy workaround and a slight inconvenience to just delete/change those service files on the affected images.

> We can probably remove this condition from all those units as they are only defined here and thus only included in our images and it should be safe to run those in all cases. One point that speaks against this that I can think of would be on live installation mediums downstream for Bazzite/Bluefin/Aurora at least, which are generated from the regular container images but are not booted with ostree/bootc with composefs backend, so they do still contain the services from here that are only supposed to trigger on the real booted system. I'm not up-to-date on the behavior/state of generic bootc image builder created ISOs or official Fedora Atomic Desktops ones. Removing the check now would mean that those who rely on them not firing off in certain scenarios could potentially break/change things in unexpected ways (I don't think anything bad would happen on those listed here though). It's not a big issue as it would be an easy workaround and a slight inconvenience to just delete/change those service files on the affected images.
Owner

I think it should not matter. They are workaround for missing cache update logic. The only thing that will happen is that a Live ISO with an empty or out of date cache will boot sightly slower.

I think it should not matter. They are workaround for missing cache update logic. The only thing that will happen is that a Live ISO with an empty or out of date cache will boot sightly slower.
Owner

The special Kinoite one will be removed in F46+

The special Kinoite one will be removed in F46+
Author

Thinking about this again, I see some services in bootc-base-images using

ConditionPathIsMountPoint=/sysroot instead which should not change behavior and will also work on composefs @siosm wdyt?

I'm fine with removing checks completely as well

Thinking about this again, I see some services in bootc-base-images using `ConditionPathIsMountPoint=/sysroot` instead which should not change behavior and will also work on composefs @siosm wdyt? I'm fine with removing checks completely as well
Owner

Using ConditionPathIsMountPoint=/sysroot sounds good to me.

Using `ConditionPathIsMountPoint=/sysroot` sounds good to me.
siosm closed this issue 2026-10-30 20:36:55 +00:00
Sign in to join this conversation.
No description provided.