mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
nixos/collectd: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
parent
78329e37aa
commit
09af9fcd34
1 changed files with 4 additions and 7 deletions
|
@ -79,6 +79,10 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.dataDir}' - ${cfg.user} - - -"
|
||||
];
|
||||
|
||||
systemd.services.collectd = {
|
||||
description = "Collectd Monitoring Agent";
|
||||
after = [ "network.target" ];
|
||||
|
@ -87,16 +91,9 @@ in {
|
|||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/sbin/collectd -C ${conf} -f";
|
||||
User = cfg.user;
|
||||
PermissionsStartOnly = true;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
};
|
||||
|
||||
preStart = ''
|
||||
mkdir -p "${cfg.dataDir}"
|
||||
chmod 755 "${cfg.dataDir}"
|
||||
chown -R ${cfg.user} "${cfg.dataDir}"
|
||||
'';
|
||||
};
|
||||
|
||||
users.users = optional (cfg.user == "collectd") {
|
||||
|
|
Loading…
Reference in a new issue