trust-dns: bump StartLimitBurst so systemd doesnt abort the service too early

This commit is contained in:
2024-05-14 08:50:37 +00:00
parent 2a199bf373
commit 3a7c9022af
2 changed files with 6 additions and 2 deletions

View File

@@ -187,7 +187,11 @@ in
User = "trust-dns"; User = "trust-dns";
Group = "trust-dns"; Group = "trust-dns";
wantedBy = lib.mkForce []; wantedBy = lib.mkForce [];
# there can be a lot of restarts as interfaces toggle,
# particularly around the DHCP/NetworkManager stuff.
StartLimitBurst = 60;
}; };
# trust-dns.unitConfig.StartLimitIntervalSec = 60;
} }
(lib.mapAttrs' (lib.mapAttrs'
(flavor: instanceConfig: { (flavor: instanceConfig: {

View File

@@ -108,11 +108,11 @@ def apply_zone(nm_config: NmConfig, ops: Ops) -> None:
# formatting preference: when these configs are `cat`d together, empty-line separators help distinguish # formatting preference: when these configs are `cat`d together, empty-line separators help distinguish
specialized_config = '\n' + specialized_config specialized_config = '\n' + specialized_config
# TODO: i'm not sure how this behaves in the presence of multiple interfaces.
# do i want to persist config-per-interface, and then merge them, on every change?
conn_config_path = f"{DHCP_CONFIGS}/{nm_config.conn_id}.toml" conn_config_path = f"{DHCP_CONFIGS}/{nm_config.conn_id}.toml"
ops.makedirs(DHCP_CONFIGS) ops.makedirs(DHCP_CONFIGS)
ops.write_file(conn_config_path, specialized_config) ops.write_file(conn_config_path, specialized_config)
# TODO: don't restart if the merged config is expected to be the same;
# restarts are costly, especially since they dump the cache!
ops.exec_([ ops.exec_([
"systemctl", "systemctl",
"restart", "restart",