sync with OM

This commit is contained in:
akdengi 2013-11-07 14:47:27 +04:00
parent 680bdd4624
commit 0efc158843
11 changed files with 443 additions and 213 deletions

View file

@ -1,4 +1,4 @@
sources: sources:
dhcp-4.2.5-P1.tar.gz: 120b6e476b2ac0d35e1dc8dee53752c42449b925 dhcp-4.2.5.tar.gz: d029505509aee83ea28972d5d1c95dc4b5db99f1
dhcp-4.2.5-P1.tar.gz.sha512.asc: d43248ba82d8a2f393f2f6c283ea06fb2df38d18 dhcp-4.2.5.tar.gz.sha512.asc: ac49b30ef17acb36cc5603faa5d780e423aa0e06
dhcp-dynamic-dns-examples.tar.bz2: d33980aad3e0380fc89f8346ab37786d39157696 dhcp-dynamic-dns-examples.tar.bz2: d33980aad3e0380fc89f8346ab37786d39157696

View file

@ -1,44 +0,0 @@
diff -up dhcp-4.2.0/client/clparse.c.requested dhcp-4.2.0/client/clparse.c
--- dhcp-4.2.0/client/clparse.c.requested 2010-07-21 13:29:05.000000000 +0200
+++ dhcp-4.2.0/client/clparse.c 2010-07-21 13:50:29.000000000 +0200
@@ -37,7 +37,7 @@
struct client_config top_level_config;
-#define NUM_DEFAULT_REQUESTED_OPTS 9
+#define NUM_DEFAULT_REQUESTED_OPTS 14
struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1];
static void parse_client_default_duid(struct parse *cfile);
@@ -111,6 +111,31 @@ isc_result_t read_client_conf ()
option_code_hash_lookup(&default_requested_options[8],
dhcpv6_universe.code_hash, &code, 0, MDL);
+ /* 10 */
+ code = DHO_NIS_DOMAIN;
+ option_code_hash_lookup(&default_requested_options[9],
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 11 */
+ code = DHO_NIS_SERVERS;
+ option_code_hash_lookup(&default_requested_options[10],
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 12 */
+ code = DHO_NTP_SERVERS;
+ option_code_hash_lookup(&default_requested_options[11],
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 13 */
+ code = DHO_INTERFACE_MTU;
+ option_code_hash_lookup(&default_requested_options[12],
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 14 */
+ code = DHO_DOMAIN_SEARCH;
+ option_code_hash_lookup(&default_requested_options[13],
+ dhcp_universe.code_hash, &code, 0, MDL);
+
for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
if (default_requested_options[code] == NULL)
log_fatal("Unable to find option definition for "

View file

@ -1,22 +0,0 @@
diff -Naur dhcp-4.2.5-P1/client/dhclient.conf.5 dhcp-4.2.5-P1.oden/client/dhclient.conf.5
--- dhcp-4.2.5-P1/client/dhclient.conf.5 2013-03-05 19:26:51.000000000 +0100
+++ dhcp-4.2.5-P1.oden/client/dhclient.conf.5 2013-03-28 11:55:37.131387053 +0100
@@ -202,7 +202,8 @@
options. Only the option names should be specified in the request
statement - not option parameters. By default, the DHCPv4 client
requests the subnet-mask, broadcast-address, time-offset, routers,
-domain-name, domain-name-servers and host-name options while the DHCPv6
+domain-search, domain-name, domain-name-servers, host-name, nis-domain,
+nis-servers, ntp-servers and interface-mtu options while the DHCPv6
client requests the dhcp6 name-servers and domain-search options. Note
that if you enter a \'request\' statement, you over-ride these defaults
and these options will not be requested.
@@ -713,7 +714,7 @@
supersede domain-search "fugue.com", "rc.vix.com", "home.vix.com";
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
- domain-name, domain-name-servers, host-name;
+ domain-search, domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
script "CLIENTBINDIR/dhclient-script";
media "media 10baseT/UTP", "media 10base2/BNC";

217
dhcp.spec
View file

@ -1,19 +1,15 @@
%define _catdir /var/cache/man #define plevel P1
%define _tmpfilesdir /usr/lib/tmpfiles.d/
%define major_version 4.2.5
%define patch_version P1
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
Name: dhcp Name: dhcp
Epoch: 3 Epoch: 3
Version: %{major_version}%{patch_version} Version: 4.2.5
Release: 2 Release: %{?plevel:0.P%{plevel}.}3
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
License: Distributable License: Distributable
Group: System/Servers Group: System/Servers
URL: http://www.isc.org/software/dhcp Url: http://www.isc.org/software/dhcp
Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz Source0: ftp://ftp.isc.org/isc/%{name}/%{version}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz
Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}-%{patch_version}/%{name}-%{major_version}-%{patch_version}.tar.gz.sha512.asc Source1: ftp://ftp.isc.org/isc/%{name}/%{version}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz.sha512.asc
Source2: dhcpd.conf Source2: dhcpd.conf
Source4: dhcp-dynamic-dns-examples.tar.bz2 Source4: dhcp-dynamic-dns-examples.tar.bz2
Source7: dhcpreport.pl Source7: dhcpreport.pl
@ -21,8 +17,11 @@ Source8: dhcpd-chroot.sh
# (eugeni) dhclient-exit-hooks script # (eugeni) dhclient-exit-hooks script
Source9: dhclient-exit-hooks Source9: dhclient-exit-hooks
Source10: draft-ietf-dhc-ldap-schema-01.txt Source10: draft-ietf-dhc-ldap-schema-01.txt
Source11: dhcpd.init
Source12: dhcpd.service Source12: dhcpd.service
Source13: dhcpd6.init
Source14: dhcpd6.service Source14: dhcpd6.service
Source15: dhcrelay.init
Source16: dhcrelay.service Source16: dhcrelay.service
Source17: dhcpd.tmpfiles Source17: dhcpd.tmpfiles
Source18: dhclient.tmpfiles Source18: dhclient.tmpfiles
@ -32,17 +31,23 @@ Patch100: dhcp-4.2.2-ifup.patch
Patch101: dhcp-4.2.2-fix-format-errors.patch Patch101: dhcp-4.2.2-fix-format-errors.patch
# prevents needless deassociation, working around mdv bug #43441 # prevents needless deassociation, working around mdv bug #43441
Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch
Patch103: dhcp-4.2.5-P1-man.patch
# fedora patches # fedora patches
Patch7: dhcp-4.2.0-default-requested-options.patch # Handle Xen partial UDP checksums
Patch8: dhcp-4.2.2-xen-checksum.patch Patch8: dhcp-4.2.2-xen-checksum.patch
# If the ipv6 kernel module is missing, do not segfault
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367])
Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch
# Handle cases in add_timeout() where the function is called with a NULL
# value for the 'when' parameter
Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch
# Ensure 64-bit platforms parse lease file dates & times correctly
Patch18: dhcp-4.2.4-64_bit_lease_parse.patch Patch18: dhcp-4.2.4-64_bit_lease_parse.patch
BuildRequires: groff-for-man
BuildRequires: libtool
BuildRequires: groff-base
BuildRequires: systemd-units
BuildRequires: bind-devel
BuildRequires: openldap-devel BuildRequires: openldap-devel
Requires(post): rpm-helper
Requires(preun): rpm-helper
%description %description
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
@ -91,10 +96,9 @@ DHCP server and a DHCP relay agent.
%package server %package server
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
Group: System/Servers Group: System/Servers
Requires: dhcp-common = %{epoch}:%{version}-%{release} Requires: dhcp-common >= %{EVRD}
Requires(post): systemd Requires(post,preun): rpm-helper
Requires(post): rpm-helper Requires(post,postun): systemd-units
Requires(preun): rpm-helper
%description server %description server
DHCP server is the Internet Software Consortium (ISC) DHCP server for various DHCP server is the Internet Software Consortium (ISC) DHCP server for various
@ -107,8 +111,8 @@ network. You will also need to install the base dhcp package.
%package client %package client
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client
Group: System/Servers Group: System/Servers
Requires: dhcp-common = %{epoch}:%{version}-%{release} Requires: dhcp-common >= %{EVRD}
Requires(post): systemd Provides: dhcp-client-daemon
%description client %description client
DHCP client is the Internet Software Consortium (ISC) DHCP client for various DHCP client is the Internet Software Consortium (ISC) DHCP client for various
@ -122,10 +126,8 @@ install the base dhcp package.
%package relay %package relay
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay
Group: System/Servers Group: System/Servers
Requires: dhcp-common = %{epoch}:%{version}-%{release} Requires: dhcp-common >= %{EVRD}
Requires(post): systemd Requires(post,preun): rpm-helper
Requires(post): rpm-helper
Requires(preun): rpm-helper
%description relay %description relay
DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP
@ -133,106 +135,101 @@ packets. It is used on a subnet with DHCP clients to "relay" their requests
to a subnet that has a DHCP server on it. Because DHCP packets can be to a subnet that has a DHCP server on it. Because DHCP packets can be
broadcast, they will not be routed off of the local subnet. The DHCP relay broadcast, they will not be routed off of the local subnet. The DHCP relay
takes care of this for the client. You will need to set the environment takes care of this for the client. You will need to set the environment
variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before variable SERVERS and optionally OPTIONS in %{_sysconfdir}/sysconfig/dhcrelay before
starting the server. starting the server.
%package devel %package devel
Summary: Development headers and libraries for the dhcpctl API Summary: Development headers and libraries for the dhcpctl API
Group: Development/Other Group: Development/Other
Requires: dhcp-common = %{epoch}:%{version}-%{release} Requires: dhcp-common >= %{EVRD}
%description devel %description devel
DHCP devel contains all of the libraries and headers for developing with the DHCP devel contains all of the libraries and headers for developing with the
Internet Software Consortium (ISC) dhcpctl API. Internet Software Consortium (ISC) dhcpctl API.
%prep %prep
%setup -q -n %{name}-%{major_version}-%{patch_version} %setup -qn %{name}-%{version}%{?plevel:-%{plevel}}
%patch100 -p1 -b .ifup %apply_patches
%patch101 -p1 -b .format_not_a_string_literal_and_no_format_arguments autoreconf -fi
%patch102 -p1 -b .prevent_wireless_deassociation
%patch103 -p1 -b .man
# Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search # remove empty files
# to the list of default requested DHCP options find -size 0 |grep ldap | xargs rm -rf
%patch7 -p1 -b .requested
# Handle Xen partial UDP checksums
%patch8 -p1 -b .xen
# If the ipv6 kernel module is missing, do not segfault
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367])
%patch15 -p1 -b .noipv6
# Handle cases in add_timeout() where the function is called with a NULL
# value for the 'when' parameter
%patch17 -p1 -b .dracut
# Ensure 64-bit platforms parse lease file dates & times correctly
%patch18 -p1 -b .64-bit_lease_parse
install -m0644 %{SOURCE10} doc cp %{SOURCE10} doc
%build %build
%serverbuild %serverbuild_hardened
%configure2_5x --enable-paranoia --enable-early-chroot \ %configure2_5x \
--enable-paranoia \
--enable-early-chroot \
--with-ldapcrypto \ --with-ldapcrypto \
--with-srv-lease-file=%{_var}/lib/dhcpd/dhcpd.leases \ --with-srv-lease-file=%{_localstatedir}/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=%{_var}/lib/dhcpd/dhcpd6.leases \ --with-srv6-lease-file=%{_localstatedir}/lib/dhcp/dhcpd6.leases \
--with-cli-lease-file=%{_var}/lib/dhclient/dhclient.leases \ --with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
--with-cli6-lease-file=%{_var}/lib/dhclient/dhclient6.leases \ --with-cli6-lease-file=%{_localstatedir}/lib/dhcp/dhclient6.leases \
--with-srv-pid-file=/run/dhcpd/dhcpd.pid \ --with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \
--with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \ --with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \
--with-cli-pid-file=/run/dhclient/dhclient.pid \ --with-cli-pid-file=%{_var}/run/dhclient.pid \
--with-cli6-pid-file=/run/dhclient/dhclient6.pid \ --with-cli6-pid-file=%{_var}/run/dhclient6.pid \
--with-relay-pid-file=/run/dhcrelay/dhcrelay.pid \ --with-relay-pid-file=%{_var}/run/dhcrelay.pid
--disable-static
%make %make
%install %install
rm -rf %{buildroot}
%makeinstall_std %makeinstall_std
# Install correct dhclient-script # Install correct dhclient-script
install -d %{buildroot}/sbin install -p -m755 client/scripts/linux -D %{buildroot}/sbin/dhclient-script
mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script
install -d %{buildroot}%{_unitdir} install -m644 %{SOURCE12} -D %{buildroot}%{_unitdir}/dhcpd.service
install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service install -m644 %{SOURCE14} -D %{buildroot}%{_unitdir}/dhcpd6.service
install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service install -m644 %{SOURCE16} -D %{buildroot}%{_unitdir}/dhcrelay.service
install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service
install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf
install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf
install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf
install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir} install -m755 %{SOURCE11} -D %{buildroot}%{_initrddir}/dhcpd
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir} install -m755 %{SOURCE13} -D %{buildroot}%{_initrddir}/dhcpd6
install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir} install -m755 %{SOURCE15} -D %{buildroot}%{_initrddir}/dhcrelay
install -m755 %{SOURCE7} -D %{buildroot}%{_sbindir}/dhcpreport.pl
install -m755 %{SOURCE8} -D %{buildroot}%{_sbindir}/dhcpd-chroot.sh
install -m644 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/dhcpd.conf
install -m755 contrib/ldap/dhcpd-conf-to-ldap -D %{buildroot}%{_sbindir}/dhcpd-conf-to-ldap
install -d %{buildroot}%{_var}/lib/dhclient
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases
# install exit-hooks script to /etc/ # install exit-hooks script to /etc/
install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir} install -m755 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/dhclient-exit-hooks
install -d %{buildroot}%{_sysconfdir}/sysconfig install -d %{buildroot}%{_sysconfdir}/sysconfig
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF
# You can set here various option for dhcpd # You can set here various option for dhcpd
# Which configuration file to use. # Which configuration file to use.
# CONFIGFILE="/etc/dhcpd.conf" CONFIGFILE="%{_sysconfdir}/dhcpd.conf"
# Where to store the lease state information. # Where to store the lease state information.
# LEASEFILE="/var/lib/dhcpd/dhcpd.leases" LEASEFILE="%{_localstatedir}/lib/dhcp/dhcpd.leases"
# Define INTERFACES to limit which network interfaces dhcpd listens on. # Define INTERFACES to limit which network interfaces dhcpd listens on.
# The default null value causes dhcpd to listen on all interfaces. # The default null value causes dhcpd to listen on all interfaces.
#INTERFACES="" INTERFACES=""
# Define OPTIONS with any other options to pass to the dhcpd server. # Define OPTIONS with any other options to pass to the dhcpd server.
# See dhcpd(8) for available options and syntax. # See dhcpd(8) for available options and syntax.
OPTIONS="-q" OPTIONS="-q"
EOF EOF
install -d %{buildroot}%{_var}/lib/dhcpd install -d %{buildroot}%{_localstatedir}/lib/dhcp
touch %{buildroot}%{_var}/lib/dhcpd/dhcpd.leases install -d %{buildroot}%{_var}/run/dhcpd
install -d %{buildroot}%{_var}/lib/dhclient
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases touch %{buildroot}%{_localstatedir}/lib/dhcp/dhcpd.leases
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhclient.leases
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF
# Define SERVERS with a list of one or more DHCP servers where # Define SERVERS with a list of one or more DHCP servers where
@ -255,19 +252,15 @@ rm -rf doc/ja_JP.eucJP
find -size 0 |grep ldap | xargs rm -rf find -size 0 |grep ldap | xargs rm -rf
# remove unwanted file # remove unwanted file
rm -f %{buildroot}%{_sysconfdir}/dhclient.conf.example rm %{buildroot}%{_sysconfdir}/dhclient.conf*
rm -f %{buildroot}%{_sysconfdir}/dhcpd.conf.example rm %{buildroot}%{_sysconfdir}/dhcpd.conf.example
rm -f %{buildroot}%{_libdir}/*.a
%pre server
%_pre_useradd dhcpd /dev/null /bin/false
%post server %post server
%_post_service dhcpd %_post_service dhcpd
%_tmpfilescreate dhcpd %tmpfiles_create dhcpd
# New dhcpd lease file # New dhcpd lease file
if [ ! -f %{_var}/lib/dhcpd/dhcpd.leases ]; then if [ ! -f %{_localstatedir}/lib/dhcp/dhcpd.leases ]; then
touch %{_var}/lib/dhcpd/dhcpd.leases touch %{_localstatedir}/lib/dhcp/dhcpd.leases
fi fi
%preun server %preun server
@ -275,88 +268,72 @@ fi
%post relay %post relay
%_post_service dhcrelay %_post_service dhcrelay
%_tmpfilescreate dhcrelay %tmpfiles_create dhcrelay
%preun relay %preun relay
%_preun_service dhcrelay %_preun_service dhcrelay
%post client %post client
touch %{_var}/lib/dhclient/dhclient.leases %tmpfiles_create dhclient
%_tmpfilescreate dhclient touch %{_localstatedir}/lib/dhclient/dhclient.leases
%postun client %postun client
rm -rf %{_var}/lib/dhclient/dhclient.leases rm -rf %{_localstatedir}/lib/dhclient/dhclient.leases
%files common %files common
%doc README contrib/ldap/README.ldap RELNOTES %doc README contrib/ldap/README.ldap RELNOTES
%doc contrib/3.0b1-lease-convert %doc contrib/3.0b1-lease-convert
%dir %{_localstatedir}/lib/dhcp
%{_mandir}/man5/dhcp-options.5* %{_mandir}/man5/dhcp-options.5*
%files doc %files doc
%doc doc/* %doc doc/*
%files server %files server
%doc server/dhcpd.conf.example tests/failover contrib/ldap/dhcp.schema %doc tests/failover contrib/ldap/dhcp.schema
%{_unitdir}/dhcpd.service %{_unitdir}/dhcpd.service
%{_unitdir}/dhcpd6.service %{_unitdir}/dhcpd6.service
%{_tmpfilesdir}/dhcpd.conf %{_tmpfilesdir}/dhcpd.conf
%{_initrddir}/dhcpd
%{_initrddir}/dhcpd6
%config(noreplace) %{_sysconfdir}/dhcpd.conf %config(noreplace) %{_sysconfdir}/dhcpd.conf
%config(noreplace) %{_sysconfdir}/dhclient-exit-hooks %config(noreplace) %{_sysconfdir}/dhclient-exit-hooks
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhcpd.leases
%{_sbindir}/dhcpd %{_sbindir}/dhcpd
%{_sbindir}/dhcpreport.pl %{_sbindir}/dhcpreport.pl
%{_sbindir}/dhcpd-conf-to-ldap %{_sbindir}/dhcpd-conf-to-ldap
%{_sbindir}/dhcpd-chroot.sh %{_sbindir}/dhcpd-chroot.sh
%{_bindir}/omshell %{_bindir}/omshell
%{_mandir}/man1/omshell.1* %{_mandir}/man1/omshell.1*
%{_mandir}/man3/omapi.3*
%{_mandir}/man5/dhcpd.conf.5* %{_mandir}/man5/dhcpd.conf.5*
%{_mandir}/man5/dhcpd.leases.5* %{_mandir}/man5/dhcpd.leases.5*
%{_mandir}/man5/dhcp-eval.5* %{_mandir}/man5/dhcp-eval.5*
%{_mandir}/man8/dhcpd.8* %{_mandir}/man8/dhcpd.8*
%dir %{_var}/lib/dhcpd %dir %{_var}/run/dhcpd
%config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd.leases
%files relay %files relay
%{_unitdir}/dhcrelay.service %{_unitdir}/dhcrelay.service
%{_tmpfilesdir}/dhcrelay.conf %{_tmpfilesdir}/dhcrelay.conf
%{_initrddir}/dhcrelay
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay %config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
%{_tmpfilesdir}/dhclient.conf
%{_sbindir}/dhcrelay %{_sbindir}/dhcrelay
%{_mandir}/man8/dhcrelay.8* %{_mandir}/man8/dhcrelay.8*
%files client %files client
%doc client/dhclient.conf.example %config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhclient.leases
%attr (0755,root,root) /sbin/dhclient-script %config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
%{_tmpfilesdir}/dhclient.conf /sbin/dhclient-script
/sbin/dhclient /sbin/dhclient
%{_mandir}/man5/dhclient.conf.5* %{_mandir}/man5/dhclient.conf.5*
%{_mandir}/man5/dhclient.leases.5* %{_mandir}/man5/dhclient.leases.5*
%{_mandir}/man8/dhclient.8* %{_mandir}/man8/dhclient.8*
%{_mandir}/man8/dhclient-script.8* %{_mandir}/man8/dhclient-script.8*
%dir %{_var}/lib/dhclient %dir %{_var}/lib/dhclient
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
%files devel %files devel
%{_includedir}/* %{_includedir}/*
%{_libdir}/*.a
%{_mandir}/man3/* %{_mandir}/man3/*
%exclude %{_mandir}/man3/omapi.3.xz
%changelog
* Wed Jul 31 2013 akdengi <akdengi>
- P103: rediff
- 4.2.5-P1 (fixes CVE-2013-2494)
- drop bogus br on bind-devel
- Make sure ldap service is started before dhcpd
- Use tmpfiles macros and add system version to requires
- add fedora patch adding requesting more options by default
- drop static libs
- use /run instead of /var/run for pid files
- switch to tmpfs for /run subdirectories
- use distinct state directories for client and server, as in fedora
- drop sysinit support
- Fix systemd units to report correct status on startup
- Add dhcpd user
- Fix service files extension

0
dhcpd-chroot.sh Executable file → Normal file
View file

View file

@ -16,7 +16,7 @@ subnet 192.168.0.0 netmask 255.255.255.0 {
# we want the nameserver to appear at a fixed address # we want the nameserver to appear at a fixed address
host ns { host ns {
next-server fixed.domain.org; next-server fixed.mandrakesoft.com;
hardware ethernet 12:34:56:78:AB:CD; hardware ethernet 12:34:56:78:AB:CD;
fixed-address 192.168.0.10; fixed-address 192.168.0.10;
} }

118
dhcpd.init Normal file
View file

@ -0,0 +1,118 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: dhcpd
# Default-Start:
# Default-Stop: 0 6
# Should-Start: ldap
# Required-Start: $network
# Should-Stop: ldap
# Required-Stop:
# Short-Description: Start and stop the DHCP server
# Description: dhcpd provides the Dynamic Host Configuration Protocol (DHCP)
# server.
### END INIT INFO
#
# The fields below are left around for legacy tools (will remove later).
#
# chkconfig: - 65 35
# description: dhcpd provides the Dynamic Host Configuration Protocol (DHCP) \
# server
# processname: dhcpd
# config: /etc/dhcpd.conf
# config: /var/lib/dhcpd/dhcpd.leases
# pidfile: /var/run/dhcpd.pid
. /etc/rc.d/init.d/functions
[ -x /usr/sbin/dhcpd ] || exit 0
# Which configuration file to use.
CONFIGFILE="/etc/dhcpd.conf"
# Where to store the lease state information.
LEASEFILE="/var/lib/dhcp/dhcpd.leases"
# Define INTERFACES to limit which network interfaces dhcpd listens on.
# The default null value causes dhcpd to listen on all interfaces.
INTERFACES=""
# Define OPTIONS with any other options to pass to the dhcpd server.
OPTIONS="-q"
# Values specified in this file override the defaults above.
[ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd
[ -f $CONFIGFILE ] || exit 0
[ -f $LEASEFILE ] || exit 0
RETVAL=0
start() {
echo -n "Starting dhcpd: "
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -chroot ${ROOTDIR}"
fi
daemon /usr/sbin/dhcpd -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
return $RETVAL
}
stop() {
echo -n "Shutting down dhcpd: "
if [ -r ${ROOTDIR}/var/run/dhcpd/dhcpd.pid ]; then
kill -TERM `cat ${ROOTDIR}/var/run/dhcpd/dhcpd.pid`
RETVAL=$?
[ "$RETVAL" = 0 ] && success "stop" || failure "stop"
else
success "already stopped"
RETVAL=0
fi
[ $RETVAL -eq 0 ] && rm -f ${ROOTDIR}/var/run/dhcpd/dhcpd.pid
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dhcpd
echo
return $RETVAL
}
configtest() {
/usr/sbin/dhcpd -q -t -cf $CONFIGFILE
RETVAL=$?
if [ $RETVAL -eq 1 ]; then
/usr/sbin/dhcpd -t -cf $CONFIGFILE
else
echo "Syntax: OK" >&2
fi
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/dhcpd ]; then
stop
start
RETVAL=$?
fi
;;
configtest)
configtest
;;
status)
status dhcpd
RETVAL=$?
;;
*)
echo "Usage: dhcpd {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL

View file

@ -1,13 +1,10 @@
[Unit] [Unit]
Description=DHCPv4 Server Daemon Description=DHCPv4 Server Daemon
After=syslog.target network.target ldap.service After=syslog.target network.target
[Service] [Service]
Environment=CONFIGFILE=/etc/dhcpd.conf LEASEFILE=/var/lib/dhcpd/dhcpd.leases EnvironmentFile=/etc/sysconfig/dhcpd
EnvironmentFile=-/etc/sysconfig/dhcpd ExecStart=/usr/sbin/dhcpd -cf $CONFIGFILE -lf $LEASEFILE $INTERFACES
Type=forking
PIDFile=/var/run/dhcpd/dhcpd.pid
ExecStart=/usr/sbin/dhcpd -pf /run/dhcpd/dhcpd.pid -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

117
dhcpd6.init Normal file
View file

@ -0,0 +1,117 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: dhcpd
# Default-Start:
# Default-Stop:
# Should-Start:
# Required-Start: $network
# Required-Stop:
# Short-Description: Start and stop the DHCPv6 server
# Description: dhcpd provides the Dynamic Host Configuration Protocol (DHCPv6)
# server.
### END INIT INFO
#
# The fields below are left around for legacy tools (will remove later).
#
# chkconfig: - 65 35
# description: dhcpd provides the Dynamic Host Configuration Protocol (DHCPv6) \
# server
# processname: dhcpd
# config: /etc/dhcpd6.conf
# config: /var/lib/dhcpd/dhcpd6.leases
# pidfile: /var/run/dhcpd6.pid
. /etc/rc.d/init.d/functions
[ -x /usr/sbin/dhcpd ] || exit 0
# Which configuration file to use.
CONFIGFILE="/etc/dhcpd6.conf"
# Where to store the lease state information.
LEASEFILE="/var/lib/dhcp/dhcpd6.leases"
# Define INTERFACES to limit which network interfaces dhcpd listens on.
# The default null value causes dhcpd to listen on all interfaces.
INTERFACES=""
# Define OPTIONS with any other options to pass to the dhcpd server.
OPTIONS="-q"
# Values specified in this file override the defaults above.
[ -f /etc/sysconfig/dhcpd6 ] && . /etc/sysconfig/dhcpd6
[ -f $CONFIGFILE ] || exit 0
[ -f $LEASEFILE ] || exit 0
RETVAL=0
start() {
echo -n "Starting dhcpd (DHCPv6): "
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
OPTIONS="${OPTIONS} -chroot ${ROOTDIR}"
fi
daemon /usr/sbin/dhcpd -6 -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd6
return $RETVAL
}
stop() {
echo -n "Shutting down dhcpd (DHCPv6): "
if [ -r ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid ]; then
kill -TERM `cat ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid`
RETVAL=$?
[ "$RETVAL" = 0 ] && success "stop" || failure "stop"
else
success "already stopped"
RETVAL=0
fi
[ $RETVAL -eq 0 ] && rm -f ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dhcpd6
echo
return $RETVAL
}
configtest() {
/usr/sbin/dhcpd -q -t -6 -cf $CONFIGFILE
RETVAL=$?
if [ $RETVAL -eq 1 ]; then
/usr/sbin/dhcpd -t -6 -cf $CONFIGFILE
else
echo "Syntax: OK" >&2
fi
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/dhcpd6 ]; then
stop
start
RETVAL=$?
fi
;;
configtest)
configtest
;;
status)
status dhcpd
RETVAL=$?
;;
*)
echo "Usage: dhcpd6 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL

View file

@ -3,11 +3,8 @@ Description=DHCPv6 Server Daemon
After=syslog.target network.target After=syslog.target network.target
[Service] [Service]
Environment=CONFIGFILE=/etc/dhcpd6.conf LEASEFILE=/var/lib/dhcp/dhcpd6.leases EnvironmentFile=/etc/sysconfig/dhcpd6
EnvironmentFile=-/etc/sysconfig/dhcpd6 ExecStart=/usr/sbin/dhcpd -d 6 -cf $CONFIGFILE -lf $LEASEFILE $INTERFACES
Type=forking
PIDFile=/var/run/dhcpd6.pid
ExecStart=/usr/sbin/dhcpd -6 -pf /run/dhcpd6.pid -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

90
dhcrelay.init Normal file
View file

@ -0,0 +1,90 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: dhcrelay
# Default-Start: 2 3 4 5
# Default-Stop:
# Should-Start:
# Required-Start: $network
# Required-Stop: $network
# Short-Description: Start and stop the DHCP relay server
# Description: dhcrelay provides the Dynamic Host Configuration Protocol (DHCP)
# relay server. This is required when your DHCP server is on
# another network segment from the clients.
### END INIT INFO
#
# The fields below are left around for legacy tools (will remove later).
#
# chkconfig: - 65 35
# description: dhcrelay provides a relay for Dynamic Host Control Protocol.
# processname: dhcrelay
# # pidfile: /var/run/dhcrelay.pid
. /etc/rc.d/init.d/functions
[ -x /usr/sbin/dhcrelay ] || exit 0
# Define SERVERS with a list of one or more DHCP servers where
# DHCP packets are to be relayed to and from. This is mandatory.
SERVERS=""
# Define OPTIONS with any other options to pass to the dhcrelay server.
OPTIONS="-q"
# Values specified in this file override the defaults above.
[ -f /etc/sysconfig/dhcrelay ] && . /etc/sysconfig/dhcrelay
# Check that at least one DHCP server to relay to was specified.
[ "${SERVERS}" = "" ] && exit 0
RETVAL=0
start() {
# Start daemons.
echo -n "Starting dhcrelay: "
daemon /usr/sbin/dhcrelay $OPTIONS $SERVERS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay
return $RETVAL
}
stop() {
# Stop daemons.
echo -n "Shutting down dhcrelay: "
killproc dhcrelay
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/dhcrelay ]; then
stop
start
RETVAL=$?
fi
;;
status)
status dhcrelay
RETVAL=$?
;;
*)
echo "Usage: dhcrelay {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL