* [PATCH pve-network] SDN: dhcp: add second check for dnsmasq
@ 2026-02-12 15:59 Lukas Sichert
2026-03-31 20:39 ` applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Sichert @ 2026-02-12 15:59 UTC (permalink / raw)
To: pve-devel; +Cc: Lukas Sichert
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 <l.sichert@proxmox.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* applied: [PATCH pve-network] SDN: dhcp: add second check for dnsmasq
2026-02-12 15:59 [PATCH pve-network] SDN: dhcp: add second check for dnsmasq Lukas Sichert
@ 2026-03-31 20:39 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-03-31 20:39 UTC (permalink / raw)
To: pve-devel, Lukas Sichert
On Thu, 12 Feb 2026 16:59:32 +0100, Lukas Sichert wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] SDN: dhcp: add second check for dnsmasq
commit: 56cb4d4e1610f61ea45fa10a16201d5be22ea95f
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-31 20:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-12 15:59 [PATCH pve-network] SDN: dhcp: add second check for dnsmasq Lukas Sichert
2026-03-31 20:39 ` applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.