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
Operation not permitted
from prometheus.exporters.smartctl
#176524
Comments
What does your resulting systemd unit look like? # systemctl cat prometheus-smartctl-exporter.service | grep DeviceAllow=
DeviceAllow=block-sd rw
DeviceAllow=block-blkext rw
DeviceAllow=char-nvme rw Also default priority is 1000, so overriding it with priority 100 should work. |
I agree, it should work, here is the before and after (created with systemctl cat) Stock nixpkgs: [root@faunus-ater:~]# cat /tmp/old | rg DeviceAllow=
DeviceAllow=block-blkext rw
DeviceAllow=block-sd rw
DeviceAllow=char-nvme rw
DeviceAllow= With my changes: [root@faunus-ater:~]# cat /tmp/new | rg DeviceAllow=
DeviceAllow=block-blkext rw
DeviceAllow=block-sd rw
DeviceAllow=char-nvme rw Evaluating |
Yup, that looks like the problem. That would mean they share the same priority, so we should likely try going down to 50 with the override. |
I'm not sure if the wiki is up to date, but 100 seems to be the default, 1000 is the default for defaults.
to mkDefault [ "" ] , but it's probably more disruptive for the other modules. Overriding with 50 seems to be the smarter option.
I could assemble a PR, seems like a very small fix |
Feel free! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Describe the bug
prometheus-smartctl-exporter
cannot access my devices. Here's an example log:I'm almost certain, that the issue is an empty
DeviceAllow=
, as the service runs fine without it, but I'd like a second opinion before sending a PR.Steps To Reproduce
Steps to reproduce the behavior:
services.prometheus
and setservices.prometheus.exporters.smartctl.enable = true
journalctl -u prometheus-smartctl-exporter
Expected behavior
smartctl
should run without errors.Additional context
Adding
services.prometheus.exporters.smartctl.devices = [ ... ]
has the same issue, overridingDeviceAllow
fixes it aswell.Possible offending code:
nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix
Line 193 in d9794b0
Not sure why the override is not working, though:
nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix
Lines 53 to 61 in c8c9a5b
Notify maintainers
@mweinelt
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: