Merge pull request #274460 from mweinelt/kea-ipc-runtimedir

nixos/kea: return to merged runtime directory; preserve runtime directories
This commit is contained in:
Martin Weinelt
2023-12-27 02:08:14 +01:00
committed by GitHub
3 changed files with 17 additions and 17 deletions
@@ -15,8 +15,8 @@ in {
type = types.listOf types.str;
example = literalExpression ''
[
"/run/kea-dhcp4/kea-dhcp4.socket"
"/run/kea-dhcp6/kea-dhcp6.socket"
"/run/kea/kea-dhcp4.socket"
"/run/kea/kea-dhcp6.socket"
]
'';
description = lib.mdDoc ''
@@ -31,13 +31,15 @@ in {
];
serviceConfig = {
User = "kea";
DynamicUser = true;
ExecStart = ''
${pkgs.prometheus-kea-exporter}/bin/kea-exporter \
--address ${cfg.listenAddress} \
--port ${toString cfg.port} \
${concatStringsSep " " cfg.controlSocketPaths}
'';
SupplementaryGroups = [ "kea" ];
RuntimeDirectory = "kea";
RuntimeDirectoryPreserve = true;
RestrictAddressFamilies = [
# Need AF_UNIX to collect data
"AF_UNIX"
+10 -12
View File
@@ -254,6 +254,8 @@ in
DynamicUser = true;
User = "kea";
ConfigurationDirectory = "kea";
RuntimeDirectory = "kea";
RuntimeDirectoryPreserve = true;
StateDirectory = "kea";
UMask = "0077";
};
@@ -288,8 +290,8 @@ in
];
environment = {
KEA_PIDFILE_DIR = "/run/kea-ctrl-agent";
KEA_LOCKFILE_DIR = "/run/kea-ctrl-agent";
KEA_PIDFILE_DIR = "/run/kea";
KEA_LOCKFILE_DIR = "/run/kea";
};
restartTriggers = [
@@ -300,7 +302,6 @@ in
ExecStart = "${package}/bin/kea-ctrl-agent -c /etc/kea/ctrl-agent.conf ${lib.escapeShellArgs cfg.ctrl-agent.extraArgs}";
KillMode = "process";
Restart = "on-failure";
RuntimeDirectory = "kea-ctrl-agent";
} // commonServiceConfig;
};
})
@@ -329,8 +330,8 @@ in
];
environment = {
KEA_PIDFILE_DIR = "/run/kea-dhcp4";
KEA_LOCKFILE_DIR = "/run/kea-dhcp4";
KEA_PIDFILE_DIR = "/run/kea";
KEA_LOCKFILE_DIR = "/run/kea";
};
restartTriggers = [
@@ -348,7 +349,6 @@ in
"CAP_NET_BIND_SERVICE"
"CAP_NET_RAW"
];
RuntimeDirectory = "kea-dhcp4";
} // commonServiceConfig;
};
})
@@ -377,8 +377,8 @@ in
];
environment = {
KEA_PIDFILE_DIR = "/run/kea-dhcp6";
KEA_LOCKFILE_DIR = "/run/kea-dhcp6";
KEA_PIDFILE_DIR = "/run/kea";
KEA_LOCKFILE_DIR = "/run/kea";
};
restartTriggers = [
@@ -394,7 +394,6 @@ in
CapabilityBoundingSet = [
"CAP_NET_BIND_SERVICE"
];
RuntimeDirectory = "kea-dhcp6";
} // commonServiceConfig;
};
})
@@ -423,8 +422,8 @@ in
];
environment = {
KEA_PIDFILE_DIR = "/run/kea-dhcp-ddns";
KEA_LOCKFILE_DIR = "/run/kea-dhcp-ddns";
KEA_PIDFILE_DIR = "/run/kea";
KEA_LOCKFILE_DIR = "/run/kea";
};
restartTriggers = [
@@ -439,7 +438,6 @@ in
CapabilityBoundingSet = [
"CAP_NET_BIND_SERVICE"
];
RuntimeDirectory = "kea-dhcp-ddns";
} // commonServiceConfig;
};
})
+2 -2
View File
@@ -431,8 +431,8 @@ let
};
kea = let
controlSocketPathV4 = "/run/kea-dhcp4/dhcp4.sock";
controlSocketPathV6 = "/run/kea-dhcp6/dhcp6.sock";
controlSocketPathV4 = "/run/kea/dhcp4.sock";
controlSocketPathV6 = "/run/kea/dhcp6.sock";
in
{
exporterConfig = {