* [Buildroot] package/dhcp/S80dhcp-*: possible bug
@ 2015-08-19 22:31 Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 1/3] package/dhcp: fix SysV init scripts option passing Benoît Thébaudeau
0 siblings, 1 reply; 4+ messages in thread
From: Benoît Thébaudeau @ 2015-08-19 22:31 UTC (permalink / raw)
To: buildroot
Hi all,
The S80dhcp-* scripts use string variables like INTERFACES that are left empty.
Because of that, the corresponding services are not started.
Previously, there were configuration files to initialize these variables, but
they have been removed by the commit 07064c0978b78356bf74408c216f524881df3362.
Is it a bug, or are these scripts supposed to just be templates (requiring a
root FS overlay to fix them) and not the actual scripts?
If it is a bug, what is the preferred way of fixing it? With a configuration
file that would be sourced by these scripts like before, or with Config.in
string options that would fill these scripts, or with something else?
Best regards,
Beno?t
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/3] package/dhcp: fix SysV init scripts option passing
2015-08-19 22:31 [Buildroot] package/dhcp/S80dhcp-*: possible bug Benoît Thébaudeau
@ 2015-08-20 20:55 ` Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 2/3] package/dhcp/S80dhcp-server: support extra options Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 3/3] package/dhcp/S80dhcp-server: allow empty INTERFACES Benoît Thébaudeau
0 siblings, 2 replies; 4+ messages in thread
From: Benoît Thébaudeau @ 2015-08-20 20:55 UTC (permalink / raw)
To: buildroot
The SysV init scripts have configuration variables like INTERFACES whose
contents have to be passed to the daemon. These variables are
initialized as empty strings, but some of them are not allowed to be
empty and there was no means of filling them apart from creating a root
FS overlay to overwrite these scripts.
This commit adds support for files under /etc/default/ to set these
configuration variables. Such light files can now be added to the root
FS skeleton or overlays without having to duplicate most of the SysV
init scripts.
Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
---
package/dhcp/S80dhcp-relay | 4 ++++
package/dhcp/S80dhcp-server | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/package/dhcp/S80dhcp-relay b/package/dhcp/S80dhcp-relay
index 9faa13d..74ec63c 100755
--- a/package/dhcp/S80dhcp-relay
+++ b/package/dhcp/S80dhcp-relay
@@ -13,6 +13,10 @@ INTERFACES=""
# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""
+# Read configuration variable file if it is present
+CFG_FILE="/etc/default/dhcrelay"
+[ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
+
# Sanity checks
test -f /usr/sbin/dhcrelay || exit 0
test -n "$INTERFACES" || exit 0
diff --git a/package/dhcp/S80dhcp-server b/package/dhcp/S80dhcp-server
index fb99f9a..b9c47ba 100755
--- a/package/dhcp/S80dhcp-server
+++ b/package/dhcp/S80dhcp-server
@@ -7,6 +7,10 @@
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=""
+# Read configuration variable file if it is present
+CFG_FILE="/etc/default/dhcpd"
+[ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
+
# Sanity checks
test -f /usr/sbin/dhcpd || exit 0
test -f /etc/dhcp/dhcpd.conf || exit 0
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Buildroot] [PATCH 2/3] package/dhcp/S80dhcp-server: support extra options
2015-08-20 20:55 ` [Buildroot] [PATCH 1/3] package/dhcp: fix SysV init scripts option passing Benoît Thébaudeau
@ 2015-08-20 20:55 ` Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 3/3] package/dhcp/S80dhcp-server: allow empty INTERFACES Benoît Thébaudeau
1 sibling, 0 replies; 4+ messages in thread
From: Benoît Thébaudeau @ 2015-08-20 20:55 UTC (permalink / raw)
To: buildroot
Add an OPTIONS configuration variable in order to make it possible to
pass custom extra options to dhcpd.
Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
---
package/dhcp/S80dhcp-server | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/package/dhcp/S80dhcp-server b/package/dhcp/S80dhcp-server
index b9c47ba..ec4aad5 100755
--- a/package/dhcp/S80dhcp-server
+++ b/package/dhcp/S80dhcp-server
@@ -7,6 +7,9 @@
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES=""
+# Additional options that are passed to the DHCP server daemon?
+OPTIONS=""
+
# Read configuration variable file if it is present
CFG_FILE="/etc/default/dhcpd"
[ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
@@ -21,7 +24,7 @@ case "$1" in
echo -n "Starting DHCP server: "
test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
- start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
+ start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $OPTIONS $INTERFACES
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Buildroot] [PATCH 3/3] package/dhcp/S80dhcp-server: allow empty INTERFACES
2015-08-20 20:55 ` [Buildroot] [PATCH 1/3] package/dhcp: fix SysV init scripts option passing Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 2/3] package/dhcp/S80dhcp-server: support extra options Benoît Thébaudeau
@ 2015-08-20 20:55 ` Benoît Thébaudeau
1 sibling, 0 replies; 4+ messages in thread
From: Benoît Thébaudeau @ 2015-08-20 20:55 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
---
package/dhcp/S80dhcp-server | 1 -
1 file changed, 1 deletion(-)
diff --git a/package/dhcp/S80dhcp-server b/package/dhcp/S80dhcp-server
index ec4aad5..fad6a36 100755
--- a/package/dhcp/S80dhcp-server
+++ b/package/dhcp/S80dhcp-server
@@ -17,7 +17,6 @@ CFG_FILE="/etc/default/dhcpd"
# Sanity checks
test -f /usr/sbin/dhcpd || exit 0
test -f /etc/dhcp/dhcpd.conf || exit 0
-test -n "$INTERFACES" || exit 0
case "$1" in
start)
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-20 20:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 22:31 [Buildroot] package/dhcp/S80dhcp-*: possible bug Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 1/3] package/dhcp: fix SysV init scripts option passing Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 2/3] package/dhcp/S80dhcp-server: support extra options Benoît Thébaudeau
2015-08-20 20:55 ` [Buildroot] [PATCH 3/3] package/dhcp/S80dhcp-server: allow empty INTERFACES Benoît Thébaudeau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox