From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7DEDB1FF13F for ; Thu, 12 Feb 2026 16:58:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C7FE3155C4; Thu, 12 Feb 2026 16:59:36 +0100 (CET) From: Lukas Sichert To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network] SDN: dhcp: add second check for dnsmasq Date: Thu, 12 Feb 2026 16:59:32 +0100 Message-ID: <20260212155932.44085-1-l.sichert@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: ADIDNDPF5635DBSIAEMYJZZTJPJMCDVJ X-Message-ID-Hash: ADIDNDPF5635DBSIAEMYJZZTJPJMCDVJ X-MailFrom: lsichert@pve.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Lukas Sichert X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently, in a system with -dnsmasq not installed, -dnsmasq-base installed, -a zone configured, applying a change to '/etc/network/interfaces' returns the error: 'Could not run before_regenerate for DHCP plugin dnsmasq command 'systemctl disable dnsmasq@' failed: exit code 1'. This is due to the system trying to regenerate the dnsmasq-config when a change is applied. Before regenerating, it only checks if dnsmasq-base is present and then tries to disable the dnsmasq systemd service. It is important to note, that the changes are applied, but the task exits with an error afterward. This commit checks if dnsmasq is installed and not just dnsmasq-base by querying for the file'/lib/systemd/system/dnsmasq.service'. Signed-off-by: Lukas Sichert --- Notes: The file could be removed in future versions or it could be deleted by the user. Perhaps a more robust way would be to check if both packages `dnsmasq` and `dnsmasq-base` are installed? I am very thankful for any opinions or suggestions regarding this. src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm index fe46cbb..477b700 100644 --- a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm +++ b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm @@ -25,7 +25,8 @@ my sub assert_dnsmasq_installed { my ($noerr) = @_; my $bin_path = "/usr/sbin/dnsmasq"; - if (!-e $bin_path) { + my $dnsmasq_service_path = "/lib/systemd/system/dnsmasq.service"; + if (!-e $bin_path || !-e $dnsmasq_service_path) { return if $noerr; # just ignore, e.g., in case zone doesn't use DHCP at all log_warn("please install the 'dnsmasq' package in order to use the DHCP feature!"); die "cannot reload with missing 'dnsmasq' package\n"; -- 2.47.3