[pve-devel] [RFC pve-network 3/3] touch the ethers file when creating the dnsmasq config

Stefan Lendl s.lendl at proxmox.com
Fri Oct 27 13:20:19 CEST 2023


removes an error from journal when newly DHCP server is configured

Signed-off-by: Stefan Lendl <s.lendl at proxmox.com>
---
 src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
index 6f8b1c4..39e4cce 100644
--- a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
+++ b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
@@ -182,6 +182,11 @@ CFG
 	$default_dnsmasq_config
     );
 
+    # touch the ethers file to avoid errors before creation
+    my $ethers_file = "$DNSMASQ_CONFIG_ROOT/$dhcp_config->{id}/ethers";
+    open(my $e, '>>', $ethers_file) or die "Could not open file '$ethers_file' $!\n";
+    close $e;
+
     unlink glob "$config_directory/10-*.conf";
 }
 
-- 
2.41.0






More information about the pve-devel mailing list