Skip to content

--no-start-daemon flag does not work with ostree-based installation #1645

@qjoly

Description

@qjoly

The --no-start-daemon CLI flag was not respected for ostree-based installations. The ostree planner always started the daemon and fail if --no-start-daemon is passed.

To provide some context, I'm trying to build a custom bootc image with nix preinstalled. to achieve this, I have to run the nix-installer script during the build, when systemd is not yet started. Here is my error :

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix |     sh -s -- install ostree --no-confirm --persistence=/var/lib/nix --no-start-daemon
info: downloading installer (https://install.determinate.systems/nix/tag/v3.9.1/nix-installer-x86_64-linux)
error: unexpected argument '--no-start-daemon' found

I noticed that the flag --no-start-daemon is working fine for linux setup but is not available with ostree, I barely know how to read rust, but the fix may be quite easy 🤞 :

https://github.com/DeterminateSystems/nix-installer/blob/main/src/planner/ostree.rs#L232

        plan.push(
-			ConfigureUpstreamInitService::plan(InitSystem::Systemd, true)
+            ConfigureUpstreamInitService::plan(InitSystem::Systemd, self.init_settings.start_daemon)
                .await
                .map_err(PlannerError::Action)?
                .boxed(),
        );
+        if self.init_settings.start_daemon {
            plan.push(
                StartSystemdUnit::plan("ensure-symlinked-units-resolve.service".to_string(), true)
                    .await
                    .map_err(PlannerError::Action)?
                    .boxed(),
            );
+        }

Steps to Reproduce:

Run the installer with --no-start-daemon on an ostree-based system (e.g., Fedora Silverblue) or setup a bootc image:

# Dockerfile - podman build -t nix-ostree-bootc .
FROM quay.io/fedora/fedora-bootc:latest
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
    sh -s -- install ostree --no-confirm --no-start-daemon --persistence=/var/lib/nix

Observe that the image build fails.

Metadata

Metadata

Assignees

No one assigned

    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