nixos/unbound: add restart (#41885)
This commit is contained in:
parent
dbdad4b44b
commit
b25a2c9614
@ -60,7 +60,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
interfaces = mkOption {
|
interfaces = mkOption {
|
||||||
default = [ "127.0.0.1" "::1" ];
|
default = [ "127.0.0.1" ] ++ optional config.networking.enableIPv6 "::1";
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = "What addresses the server should listen on.";
|
description = "What addresses the server should listen on.";
|
||||||
};
|
};
|
||||||
@ -112,8 +112,8 @@ in
|
|||||||
mkdir -m 0755 -p ${stateDir}/dev/
|
mkdir -m 0755 -p ${stateDir}/dev/
|
||||||
cp ${confFile} ${stateDir}/unbound.conf
|
cp ${confFile} ${stateDir}/unbound.conf
|
||||||
${optionalString cfg.enableRootTrustAnchor ''
|
${optionalString cfg.enableRootTrustAnchor ''
|
||||||
${pkgs.unbound}/bin/unbound-anchor -a ${rootTrustAnchorFile} || echo "Root anchor updated!"
|
${pkgs.unbound}/bin/unbound-anchor -a ${rootTrustAnchorFile} || echo "Root anchor updated!"
|
||||||
chown unbound ${stateDir} ${rootTrustAnchorFile}
|
chown unbound ${stateDir} ${rootTrustAnchorFile}
|
||||||
''}
|
''}
|
||||||
touch ${stateDir}/dev/random
|
touch ${stateDir}/dev/random
|
||||||
${pkgs.utillinux}/bin/mount --bind -n /dev/urandom ${stateDir}/dev/random
|
${pkgs.utillinux}/bin/mount --bind -n /dev/urandom ${stateDir}/dev/random
|
||||||
@ -126,6 +126,8 @@ in
|
|||||||
ProtectSystem = true;
|
ProtectSystem = true;
|
||||||
ProtectHome = true;
|
ProtectHome = true;
|
||||||
PrivateDevices = true;
|
PrivateDevices = true;
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "5s";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user