diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2019-07-06 08:52:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-06 08:52:41 +0100 |
commit | e111f2323358e0aec9274b3f7a4fb3ded620d962 (patch) | |
tree | 410163210d42ee8a598670e51571d85630b585ae /nixos/modules | |
parent | d567c486ca5ac5f0c83bb0264c325204a479a5bb (diff) | |
parent | fb4d71a39fdf0ef2477870c4f720bab10bf90174 (diff) | |
download | nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.tar nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.tar.gz nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.tar.bz2 nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.tar.lz nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.tar.xz nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.tar.zst nixpkgs-e111f2323358e0aec9274b3f7a4fb3ded620d962.zip |
Merge pull request #64329 from Izorkin/netdata
nixos/netdata: update service config
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/monitoring/netdata.nix | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nixos/modules/services/monitoring/netdata.nix b/nixos/modules/services/monitoring/netdata.nix index f264b6dd456..f9b7550af23 100644 --- a/nixos/modules/services/monitoring/netdata.nix +++ b/nixos/modules/services/monitoring/netdata.nix @@ -141,11 +141,18 @@ in { path = (with pkgs; [ gawk curl ]) ++ lib.optional cfg.python.enable (pkgs.python3.withPackages cfg.python.extraPackages); serviceConfig = { - User = cfg.user; - Group = cfg.group; Environment="PYTHONPATH=${pkgs.netdata}/libexec/netdata/python.d/python_modules"; - ExecStart = "${pkgs.netdata}/bin/netdata -D -c ${configFile}"; + ExecStart = "${pkgs.netdata}/bin/netdata -P /run/netdata/netdata.pid -D -c ${configFile}"; + ExecReload = "${pkgs.utillinux}/bin/kill -s HUP -s USR1 -s USR2 $MAINPID"; TimeoutStopSec = 60; + # User and group + User = cfg.user; + Group = cfg.group; + # Runtime directory and mode + RuntimeDirectory = "netdata"; + RuntimeDirectoryMode = "0755"; + # Performance + LimitNOFILE = "30000"; }; }; @@ -165,6 +172,11 @@ in { permissions = "u+rx,g+rx,o-rwx"; }; + security.pam.loginLimits = [ + { domain = "netdata"; type = "soft"; item = "nofile"; value = "10000"; } + { domain = "netdata"; type = "hard"; item = "nofile"; value = "30000"; } + ]; + users.users = optional (cfg.user == defaultUser) { name = defaultUser; }; |