Skip to content

Commit

Permalink
nixos/netdata: own plugins must the looked up first
Browse files Browse the repository at this point in the history
Otherwise netdata will not find python modules.
To make sure netdata still pick up our setuid version of apps.plugin
we rename the original executable.
  • Loading branch information
Mic92 committed Nov 17, 2018
1 parent aa31685 commit 34ff87e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/services/monitoring/netdata.nix
Expand Up @@ -12,7 +12,7 @@ let

localConfig = {
global = {
"plugins directory" = "${wrappedPlugins}/libexec/netdata/plugins.d ${pkgs.netdata}/libexec/netdata/plugins.d";
"plugins directory" = "${pkgs.netdata}/libexec/netdata/plugins.d ${wrappedPlugins}/libexec/netdata/plugins.d";
};
web = {
"web files owner" = "root";
Expand Down Expand Up @@ -96,7 +96,7 @@ in {
};

security.wrappers."apps.plugin" = {
source = "${pkgs.netdata}/libexec/netdata/plugins.d/apps.plugin";
source = "${pkgs.netdata}/libexec/netdata/plugins.d/apps.plugin.org";
capabilities = "cap_dac_read_search,cap_sys_ptrace+ep";
owner = cfg.user;
group = cfg.group;
Expand Down
6 changes: 6 additions & 0 deletions pkgs/tools/system/netdata/default.nix
Expand Up @@ -17,6 +17,12 @@ stdenv.mkDerivation rec{
./no-files-in-etc-and-var.patch
];

postInstall = stdenv.lib.optionalString (!stdenv.isDarwin) ''
# rename this plugin so netdata will look for setuid wrapper
mv $out/libexec/netdata/plugins.d/apps.plugin \
$out/libexec/netdata/plugins.d/apps.plugin.org
'';

configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
Expand Down

0 comments on commit 34ff87e

Please sign in to comment.