From 47cf8dc4e5c0862c74b0e5062ae3b59a575fa8430bb511fe01688e07f6e3db20 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski Date: Wed, 31 Aug 2011 09:13:05 +0000 Subject: [PATCH] - Set the DHCPD_CONF_INCLUDE_FILES and the DHCPD6_CONF_INCLUDE_FILES variables to /etc/dhcpd.d and /etc/dhcpd6.d by default, so there are well-defined directories expected to contain additional config files (bnc#690585). OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=77 --- dhcp.changes | 8 ++++++++ dhcp.spec | 3 +++ rc.dhcpd | 1 + rc.dhcpd6 | 2 +- sysconfig.dhcpd | 38 ++++++++++++++++++++------------------ 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/dhcp.changes b/dhcp.changes index 1c06616..aa7742a 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Aug 31 08:42:12 UTC 2011 - mt@suse.com + +- Set the DHCPD_CONF_INCLUDE_FILES and the DHCPD6_CONF_INCLUDE_FILES + variables to /etc/dhcpd.d and /etc/dhcpd6.d by default, so there + are well-defined directories expected to contain additional config + files (bnc#690585). + ------------------------------------------------------------------- Mon Aug 29 15:15:44 UTC 2011 - mt@suse.de diff --git a/dhcp.spec b/dhcp.spec index f3dcd29..a70230f 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -308,6 +308,7 @@ make install DESTDIR="$RPM_BUILD_ROOT" # directories install -d -m0755 $RPM_BUILD_ROOT/sbin install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/init.d +install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/dhcpd{,6}.d install -d -m0755 $RPM_BUILD_ROOT/%{susefw2dir} install -d -m0755 $RPM_BUILD_ROOT/%{omc_svcdir} %if %{with_ldap} @@ -458,6 +459,8 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %config %{_sysconfdir}/init.d/dhcpd6 %config(noreplace) %{_sysconfdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhcpd6.conf +%attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd.d/ +%attr(755,root,root) %dir %config(noreplace) %ghost %{_sysconfdir}/dhcpd6.d/ %dir %{_localstatedir}/lib/dhcp %dir %{_localstatedir}/lib/dhcp/etc %dir %{_localstatedir}/lib/dhcp/dev diff --git a/rc.dhcpd b/rc.dhcpd index 4a8a57d..ebc0e66 100644 --- a/rc.dhcpd +++ b/rc.dhcpd @@ -53,6 +53,7 @@ test "$SUPPORTS_RUN_AS" = no && DHCPD_RUN_AS="" test "$DHCPD_BINARY" = "/usr/sbin/dhcpd.lpf" -o \ "$DHCPD_BINARY" = "/usr/sbin/dhcpd.bsd" && \ DHCPD_BINARY=/usr/sbin/dhcpd +DHCPD_CONF_INCLUDE_FILES=${DHCPD_CONF_INCLUDE_FILES:-/etc/dhcpd.d} DAEMON='ISC DHCPv4 4.x Server' DAEMON_BIN=${DHCPD_BINARY:=/usr/sbin/dhcpd} diff --git a/rc.dhcpd6 b/rc.dhcpd6 index 121be37..bc656db 100644 --- a/rc.dhcpd6 +++ b/rc.dhcpd6 @@ -52,7 +52,7 @@ DHCPD_RUN_CHROOTED=$DHCPD6_RUN_CHROOTED DHCPD_RUN_AS=$DHCPD6_RUN_AS DHCPD_BINARY=$DHCPD6_BINARY DHCPD_INTERFACE=$DHCPD6_INTERFACE -DHCPD_CONF_INCLUDE_FILES=$DHCPD6_CONF_INCLUDE_FILES +DHCPD_CONF_INCLUDE_FILES=${DHCPD6_CONF_INCLUDE_FILES:-/etc/dhcpd6.d} DHCPD_OTHER_ARGS=$DHCPD6_OTHER_ARGS test "$SUPPORTS_CHROOT" = no && DHCPD_RUN_CHROOTED=no diff --git a/sysconfig.dhcpd b/sysconfig.dhcpd index 7aab6fa..87f79da 100644 --- a/sysconfig.dhcpd +++ b/sysconfig.dhcpd @@ -80,8 +80,8 @@ DHCPD6_IFUP_RESTART="" # # Shall the DHCP server dhcpd run in a chroot jail (/var/lib/dhcp)? # -# Each time you start dhcpd with the init script, /etc/dhcpd.conf will -# be copied to /var/lib/dhcp/etc/. +# Each time you start dhcpd with the init script, /etc/dhcpd.conf +# will be copied to /var/lib/dhcp/etc/. # # Some files that are important for hostname to IP address resolution # (/etc/{gai.conf,nsswitch.conf,resolv.conf,host.conf,hosts,localtime}, @@ -97,10 +97,10 @@ DHCPD_RUN_CHROOTED="yes" ## Default: yes ## ServiceRestart: dhcpd6 # -# Shall the DHCP server dhcpd run in a chroot jail (/var/lib/dhcp)? +# Shall the DHCP server dhcpd run in a chroot jail (/var/lib/dhcp6)? # -# Each time you start dhcpd with the init script, /etc/dhcpd.conf will -# be copied to /var/lib/dhcp/etc/. +# Each time you start dhcpd with the init script, /etc/dhcpd6.conf +# will be copied to /var/lib/dhcp6/etc/. # # Some files that are important for hostname to IP address resolution # (/etc/{gai.conf,nsswitch.conf,resolv.conf,host.conf,hosts,localtime}, @@ -108,12 +108,12 @@ DHCPD_RUN_CHROOTED="yes" # also be copied to the chroot jail by the init script when you start # it (less than 1MB altogether). # -# The pid file will be in /var/lib/dhcp/var/run/dhcpd.pid. +# The pid file will be in /var/lib/dhcp6/var/run/dhcpd.pid. # DHCPD6_RUN_CHROOTED="yes" ## Type: string -## Default: "" +## Default: "/etc/dhcpd.d" ## ServiceRestart: dhcpd # # Since version 3, dhcpd.conf can contain include statements. @@ -121,28 +121,30 @@ DHCPD6_RUN_CHROOTED="yes" # files will be copied to $chroot/etc/, when dhcpd is started in the # chroot jail. (/etc/dhcpd.conf is always copied.) # -# For your convenience, you can also specify entire directories, like -# "/etc/dhcpd.conf.d". +# For your convenience, you can also specify entire directories, +# that will be copied inclusive subdirectories. The /etc/dhcpd.d +# directory will be copied by default when it exists. # -# Example: "/etc/dhcpd.conf.shared /etc/dhcpd.conf.bootp-clients" +# Example: "/etc/foo.bar.conf /etc/dhcpd.bootp-clients.conf" # -DHCPD_CONF_INCLUDE_FILES="" +DHCPD_CONF_INCLUDE_FILES="/etc/dhcpd.d" ## Type: string -## Default: "" +## Default: "/etc/dhcpd.d" ## ServiceRestart: dhcpd6 # # Since version 3, dhcpd.conf can contain include statements. # If you enter the names of any include files here, _all_ conf -# files will be copied to $chroot/etc/, when dhcpd is started in the -# chroot jail. (/etc/dhcpd.conf is always copied.) +# files will be copied to $chroot/etc/, when dhcpd is started in +# the chroot jail. (/etc/dhcpd6.conf is always copied.) # -# For your convenience, you can also specify entire directories, like -# "/etc/dhcpd.conf.d". +# For your convenience, you can also specify entire directories, +# that will be copied inclusive subdirectories. The /etc/dhcpd6.d +# directory will be copied by default when it exists. # -# Example: "/etc/dhcpd.conf.shared /etc/dhcpd.conf.bootp-clients" +# Example: "/etc/foo.bar.conf /etc/dhcpd6.bootp-clients.conf" # -DHCPD6_CONF_INCLUDE_FILES="" +DHCPD6_CONF_INCLUDE_FILES="/etc/dhcpd6.d" ## Type: string ## Default: "dhcpd"