diff mbox

[v3,06/13] package/dhcp: systemd: allow missing environment file

Message ID 1445734779-7212-6-git-send-email-benoit.thebaudeau.dev@gmail.com
State Rejected
Headers show

Commit Message

Benoît Thébaudeau Oct. 25, 2015, 12:59 a.m. UTC
The dhcpd daemon does not require network interface names to be
specified on the command line.

>From dhcpd(8):
"The names of the network interfaces on which dhcpd should listen for
broadcasts may be specified on the command line.  This should be done
on systems where dhcpd is unable to identify non-broadcast interfaces,
but should not be required on other systems.  If no interface names
are specified on the command line dhcpd will identify all network
interfaces which are up, eliminating non-broadcast interfaces if
possible, and listen for DHCP broadcasts on each interface."

dhcpd exits with "Not configured to listen on any interfaces!" only if
no requested (those in INTERFACES, or all if empty) non-broadcast
interfaces matching the subnet declarations in dhcpd.conf are up.

Also, no extra options are required on the command line, which means
that the EnvironmentFile file does not have to be present, so make it
optional.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>

---
Changes v2 -> v3: new patch.
---
 package/dhcp/dhcpd.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Hadjinlian Nov. 4, 2015, 10:14 a.m. UTC | #1
On Sun, Oct 25, 2015 at 2:59 AM, Benoît Thébaudeau <
benoit.thebaudeau.dev@gmail.com> wrote:

> The dhcpd daemon does not require network interface names to be
> specified on the command line.
>
> >From dhcpd(8):
> "The names of the network interfaces on which dhcpd should listen for
> broadcasts may be specified on the command line.  This should be done
> on systems where dhcpd is unable to identify non-broadcast interfaces,
> but should not be required on other systems.  If no interface names
> are specified on the command line dhcpd will identify all network
> interfaces which are up, eliminating non-broadcast interfaces if
> possible, and listen for DHCP broadcasts on each interface."
>
> dhcpd exits with "Not configured to listen on any interfaces!" only if
> no requested (those in INTERFACES, or all if empty) non-broadcast
> interfaces matching the subnet declarations in dhcpd.conf are up.
>
> Also, no extra options are required on the command line, which means
> that the EnvironmentFile file does not have to be present, so make it
> optional.
>
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
>
> ---
> Changes v2 -> v3: new patch.
> ---
>  package/dhcp/dhcpd.service | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/dhcp/dhcpd.service b/package/dhcp/dhcpd.service
> index ad1300c..98cc54b 100644
> --- a/package/dhcp/dhcpd.service
> +++ b/package/dhcp/dhcpd.service
> @@ -7,7 +7,7 @@ Type=forking
>  PIDFile=/run/dhcpd.pid
>  ExecStart=/usr/sbin/dhcpd -q -pf /run/dhcpd.pid $OPTIONS $INTERFACES
>  KillSignal=SIGINT
> -EnvironmentFile=/etc/default/dhcpd
> +EnvironmentFile=-/etc/default/dhcpd
>
>  [Install]
>  WantedBy=multi-user.target
>
Reviewed-by: "Maxime Hadjinlian" <maxime.hadjinlian@gmail.com>

> --
> 2.1.4
>
>
Thomas Petazzoni Dec. 24, 2015, 2:03 p.m. UTC | #2
Dear Benoît Thébaudeau,

On Sun, 25 Oct 2015 02:59:32 +0200, Benoît Thébaudeau wrote:

> diff --git a/package/dhcp/dhcpd.service b/package/dhcp/dhcpd.service
> index ad1300c..98cc54b 100644
> --- a/package/dhcp/dhcpd.service
> +++ b/package/dhcp/dhcpd.service
> @@ -7,7 +7,7 @@ Type=forking
>  PIDFile=/run/dhcpd.pid
>  ExecStart=/usr/sbin/dhcpd -q -pf /run/dhcpd.pid $OPTIONS $INTERFACES
>  KillSignal=SIGINT
> -EnvironmentFile=/etc/default/dhcpd
> +EnvironmentFile=-/etc/default/dhcpd
>  
>  [Install]
>  WantedBy=multi-user.target

A similar change had already been done in commit
21aa707a126155533748998f4fae328b1c63d1d6.

Thanks,

Thomas
diff mbox

Patch

diff --git a/package/dhcp/dhcpd.service b/package/dhcp/dhcpd.service
index ad1300c..98cc54b 100644
--- a/package/dhcp/dhcpd.service
+++ b/package/dhcp/dhcpd.service
@@ -7,7 +7,7 @@  Type=forking
 PIDFile=/run/dhcpd.pid
 ExecStart=/usr/sbin/dhcpd -q -pf /run/dhcpd.pid $OPTIONS $INTERFACES
 KillSignal=SIGINT
-EnvironmentFile=/etc/default/dhcpd
+EnvironmentFile=-/etc/default/dhcpd
 
 [Install]
 WantedBy=multi-user.target