From 77d9ed5f6e5d9e49ce42496ae0fc4eb21714d90f Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Wed, 5 Oct 2022 11:18:33 -0600 Subject: [PATCH] isc-dhcp: avoid gratuitous reload of named Signed-off-by: Philip Prindeville --- net/isc-dhcp/files/dhcpd.init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init index e849a387d4..e72cb37977 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -463,6 +463,12 @@ general_config() { create_empty_zone "$mynet.in-addr.arpa" done + local need_reload= + + cp -p $conf_local_file ${conf_local_file}_ + cmp -s $conf_local_file ${conf_local_file}_ || need_reload=1 + rm -f ${conf_local_file}_ + cat < $conf_local_file zone "$domain" { type master; @@ -488,7 +494,7 @@ zone "$mynet.in-addr.arpa" { EOF done - /etc/init.d/named reload + [ -n "$need_reload" ] && /etc/init.d/named reload sleep 1 cat <