Open caldwell opened 1 year ago
The same trick wouldn't not be very useful because smartctl needs extended capabilities: https://github.com/nix-community/srvos/pull/303
True. I ended up also having to do:
systemd.services.telegraf.path = with pkgs; [
smartmontools "/run/wrappers"
];
security.sudo.configFile = ''
telegraf ALL=(root:root) NOPASSWD: ${pkgs.smartmontools}/bin/smartctl
'';
to get it fully working. But your wrapper with the direct capabilities looks much nicer. Is there any chance of getting that into main nixos? I'm not familiar with the srvos project…
True. I ended up also having to do:
systemd.services.telegraf.path = with pkgs; [ smartmontools "/run/wrappers" ]; security.sudo.configFile = '' telegraf ALL=(root:root) NOPASSWD: ${pkgs.smartmontools}/bin/smartctl '';
to get it fully working. But your wrapper with the direct capabilities looks much nicer. Is there any chance of getting that into main nixos? I'm not familiar with the srvos project…
Sure. Just open a nixpkgs PR. I will drop it from srvos than.
The current implementation in srvos allows everyone (= other) to execute smartctl. Please consider limiting the permissions e.g. permissions = "u=x,g=x,o=";
before integrating the wrapper in nixpkgs.
Describe the bug
I added the
smart
input plugin to telegraf in nixos:The telegraf systemd service fails to start, giving this error in the journal:
It appears as if the path is not being set up right when
smart
is enabled.I found this discussion and was able adapt the workaround mentioned there:
Expected behavior
It would be nicer if it automatically added the path when the user enables the
smart
input plugin. Something like #256928.Notify maintainers
@mic92 @roblabla @timstott @zowoq
Metadata
Priorities
Add a :+1: reaction to issues you find important.