Skip to content

Not searching for smartctl via PATH breaks NixOS #49

@vamega

Description

@vamega

I run SnapRAID on Nixos, and I just noticed that snapraid has been throwing errors in my logs. It's been broken ever since bb3aae2, which introduced a hardcoded list of paths where it looks for the smartctl binary.

The problem on NixOS is that the actual location is only to be found in the nix store. The NixOS package for this does make smartctl available on the PATH as seen here, which stopped working when a hardcoded list of locations was introduced. If the commit message is to be taken at face value, perhaps it could only look for the hardcoded locations if a binary isn't found in PATH? Or maybe the other way?

For now on NixOS, I'm able to get snapraid to work by running it under a systemd service with a bind mount for smartctl like below.

  BindReadOnlyPaths = [
    "${pkgs.smartmontools}/bin/smartctl:/usr/bin/smartctl"
  ];

This however only works for a systemd service, and cannot work when running the binary as either `root or via sudo.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions