Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/multipath: etc_prefix not configured correctly #385022

Open
3 tasks done
bzadm opened this issue Feb 25, 2025 · 0 comments
Open
3 tasks done

nixos/multipath: etc_prefix not configured correctly #385022

bzadm opened this issue Feb 25, 2025 · 0 comments
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@bzadm
Copy link
Contributor

bzadm commented Feb 25, 2025

Nixpkgs version

  • Stable (24.11)

Describe the bug

The multipath module uses the package with the default etc_prefix build option. This means the module will fail to start the service when activated on an empty system because it tries to write into the nix store, relative to the build dir ({nix path}/etc/multipath).

This should be fixed either with the module or the package. A temporary fix is to use a package override, to let the module use /etc/multipath:

  # the fibrechannel cards are setup in a multipath config, we run ZFS on top so some adjustement is required
  services.multipath = {
    enable = true;
    package = pkgs.multipath-tools.overrideAttrs (
      _finalAttrs: previousAttrs: {
        # multipathd wants to write it's binding into $(prefix)/etc
        # the nixpkgs package sets $(prefix)=$out, which leads to the daemon trying to write into the store
        # this adjustement makes it write to /etc/multipath.d at runtime
        makeFlags = previousAttrs.makeFlags ++ [ "etc_prefix=/" ];
      }
    );
  };

Steps to reproduce

Set services.multipath.enable = true; on a system with eligible hardware, it will try to write bindings etc. to the nix store. I only tested (or rather can test) with FibreChannel cards.

Expected behaviour

Write to /etc or a similiar directory.

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.13, NixOS, 24.11 (Vicuna), 24.11.20250224.3133e42
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.24.12
  • nixpkgs: not found

Notify maintainers


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

@bzadm bzadm added 0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

No branches or pull requests

1 participant