Merge pull request #64329 from Izorkin/netdata
nixos/netdata: update service config
This commit is contained in:
@@ -141,11 +141,18 @@ in {
|
|||||||
path = (with pkgs; [ gawk curl ]) ++ lib.optional cfg.python.enable
|
path = (with pkgs; [ gawk curl ]) ++ lib.optional cfg.python.enable
|
||||||
(pkgs.python3.withPackages cfg.python.extraPackages);
|
(pkgs.python3.withPackages cfg.python.extraPackages);
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
Environment="PYTHONPATH=${pkgs.netdata}/libexec/netdata/python.d/python_modules";
|
||||||
|
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;
|
User = cfg.user;
|
||||||
Group = cfg.group;
|
Group = cfg.group;
|
||||||
Environment="PYTHONPATH=${pkgs.netdata}/libexec/netdata/python.d/python_modules";
|
# Runtime directory and mode
|
||||||
ExecStart = "${pkgs.netdata}/bin/netdata -D -c ${configFile}";
|
RuntimeDirectory = "netdata";
|
||||||
TimeoutStopSec = 60;
|
RuntimeDirectoryMode = "0755";
|
||||||
|
# Performance
|
||||||
|
LimitNOFILE = "30000";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,6 +172,11 @@ in {
|
|||||||
permissions = "u+rx,g+rx,o-rwx";
|
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) {
|
users.users = optional (cfg.user == defaultUser) {
|
||||||
name = defaultUser;
|
name = defaultUser;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user