all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-network] dnsmasq: check for existence of dnsmasq binary
@ 2023-11-22 18:33 Stefan Hanreich
  2023-11-22 18:49 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hanreich @ 2023-11-22 18:33 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
index 654f9e4..ed930cf 100644
--- a/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
+++ b/src/PVE/Network/SDN/Dhcp/Dnsmasq.pm
@@ -11,6 +11,8 @@ use PVE::Tools qw(file_set_contents run_command lock_file);
 use File::Copy;
 use Net::DBus;
 
+use PVE::RESTEnvironment qw(log_warn);
+
 my $DNSMASQ_CONFIG_ROOT = '/etc/dnsmasq.d';
 my $DNSMASQ_DEFAULT_ROOT = '/etc/default';
 my $DNSMASQ_LEASE_ROOT = '/var/lib/misc';
@@ -236,6 +238,12 @@ sub after_configure {
 sub before_regenerate {
     my ($class) = @_;
 
+    my $bin_path = "/usr/sbin/dnsmasq";
+    if (!-e $bin_path) {
+	log_warn("Please install dnsmasq in order to use the DHCP feature!");
+	die;
+    }
+
     PVE::Tools::run_command(['systemctl', 'stop', "dnsmasq@*"]);
     PVE::Tools::run_command(['systemctl', 'disable', 'dnsmasq@']);
 }
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH pve-network] dnsmasq: check for existence of dnsmasq binary
  2023-11-22 18:33 [pve-devel] [PATCH pve-network] dnsmasq: check for existence of dnsmasq binary Stefan Hanreich
@ 2023-11-22 18:49 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-11-22 18:49 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stefan Hanreich

Am 22/11/2023 um 19:33 schrieb Stefan Hanreich:
> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
> ---
>  src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-22 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 18:33 [pve-devel] [PATCH pve-network] dnsmasq: check for existence of dnsmasq binary Stefan Hanreich
2023-11-22 18:49 ` [pve-devel] 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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal