- Correct %post problems in dhclient package (#495361)
- Read hooks scripts from /etc/dhcp (#495361) - Update to latest ldap-for-dhcp
This commit is contained in:
parent
a1643e997f
commit
580990a32d
@ -1,2 +1,2 @@
|
||||
dhcp-4.1.0.tar.gz
|
||||
ldap-for-dhcp-4.1.0.tar.gz
|
||||
ldap-for-dhcp-4.1.0-2.tar.gz
|
||||
|
@ -3,7 +3,7 @@
|
||||
# dhclient-script: Network interface configuration script run by
|
||||
# dhclient based on DHCP client communication
|
||||
#
|
||||
# Copyright (C) 2008 Red Hat, Inc.
|
||||
# Copyright (C) 2008, 2009 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -35,6 +35,8 @@ SAVEDIR=/var/lib/dhclient
|
||||
LOGFACILITY="local7"
|
||||
LOGLEVEL="notice"
|
||||
|
||||
ETCDIR="/etc/dhcp"
|
||||
|
||||
logmessage() {
|
||||
msg="${1}"
|
||||
logger -p ${LOGFACILITY}.${LOGLEVEL} -t "NET" "dhclient: ${msg}"
|
||||
@ -107,8 +109,8 @@ make_resolv_conf() {
|
||||
exit_with_hooks() {
|
||||
exit_status="${1}"
|
||||
|
||||
if [ -x /etc/dhclient-exit-hooks ]; then
|
||||
. /etc/dhclient-exit-hooks
|
||||
if [ -x ${ETCDIR}/dhclient-exit-hooks ]; then
|
||||
. ${ETCDIR}/dhclient-exit-hooks
|
||||
fi
|
||||
|
||||
exit ${exit_status}
|
||||
@ -236,10 +238,10 @@ dhconfig() {
|
||||
ip link set ${interface} mtu ${new_interface_mtu}
|
||||
fi
|
||||
|
||||
if [ -x /etc/dhclient-${interface}-up-hooks ]; then
|
||||
. /etc/dhclient-${interface}-up-hooks
|
||||
elif [ -x /etc/dhclient-up-hooks ]; then
|
||||
. /etc/dhclient-up-hooks
|
||||
if [ -x ${ETCDIR}/dhclient-${interface}-up-hooks ]; then
|
||||
. ${ETCDIR}/dhclient-${interface}-up-hooks
|
||||
elif [ -x ${ETCDIR}/dhclient-up-hooks ]; then
|
||||
. ${ETCDIR}/dhclient-up-hooks
|
||||
fi
|
||||
|
||||
if [[ (( -z "${GATEWAYDEV}" ) ||
|
||||
@ -360,8 +362,8 @@ dhconfig() {
|
||||
fi
|
||||
|
||||
# execute any additional client side configuration scripts we have
|
||||
if [ -d /etc/dhcp/dhclient.d ]; then
|
||||
for f in /etc/dhcp/dhclient.d/*.sh ; do
|
||||
if [ -d ${ETCDIR}/dhclient.d ]; then
|
||||
for f in ${ETCDIR}/dhclient.d/*.sh ; do
|
||||
if [ -x ${f} ]; then
|
||||
subsystem="${f%.sh}"
|
||||
subsystem="${subsystem##*/}"
|
||||
@ -386,12 +388,12 @@ get_prefix() {
|
||||
# ### MAIN
|
||||
#
|
||||
|
||||
if [ -x /etc/dhclient-enter-hooks ]; then
|
||||
if [ -x ${ETCDIR}/dhclient-enter-hooks ]; then
|
||||
exit_status=0
|
||||
|
||||
# dhclient-enter-hooks can abort dhclient-script by setting
|
||||
# the exit_status variable to a non-zero value
|
||||
. /etc/dhclient-enter-hooks
|
||||
. ${ETCDIR}/dhclient-enter-hooks
|
||||
if [ ${exit_status} -ne 0 ]; then
|
||||
exit ${exit_status}
|
||||
fi
|
||||
@ -488,8 +490,8 @@ case "${reason}" in
|
||||
fi
|
||||
|
||||
# execute any additional client side configuration scripts we have
|
||||
if [ -d /etc/dhcp/dhclient.d ]; then
|
||||
for f in /etc/dhcp/dhclient.d/*.sh ; do
|
||||
if [ -d ${ETCDIR}/dhclient.d ]; then
|
||||
for f in ${ETCDIR}/dhclient.d/*.sh ; do
|
||||
if [ -x ${f} ]; then
|
||||
subsystem="${f%.sh}"
|
||||
subsystem="${subsystem##*/}"
|
||||
@ -499,10 +501,10 @@ case "${reason}" in
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -x /etc/dhclient-${interface}-down-hooks ]; then
|
||||
. /etc/dhclient-${interface}-down-hooks
|
||||
elif [ -x /etc/dhclient-down-hooks ]; then
|
||||
. /etc/dhclient-down-hooks
|
||||
if [ -x ${ETCDIR}/dhclient-${interface}-down-hooks ]; then
|
||||
. ${ETCDIR}/dhclient-${interface}-down-hooks
|
||||
elif [ -x ${ETCDIR}/dhclient-down-hooks ]; then
|
||||
. ${ETCDIR}/dhclient-down-hooks
|
||||
fi
|
||||
|
||||
if [ -n "${alias_ip_address}" ]; then
|
||||
|
15
dhcp.spec
15
dhcp.spec
@ -4,6 +4,9 @@
|
||||
# Where dhcp configuration files are stored
|
||||
%define dhcpconfdir %{_sysconfdir}/dhcp
|
||||
|
||||
# LDAP patch version
|
||||
%define ldappatchver %{version}-2
|
||||
|
||||
Summary: Dynamic host configuration protocol software
|
||||
Name: dhcp
|
||||
Version: 4.1.0
|
||||
@ -17,7 +20,7 @@ License: ISC
|
||||
Group: System Environment/Daemons
|
||||
URL: http://isc.org/products/DHCP/
|
||||
Source0: ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}.tar.gz
|
||||
Source1: http://dcantrel.fedorapeople.org/dhcp/ldap-patch/ldap-for-dhcp-%{version}-2.tar.gz
|
||||
Source1: http://dcantrel.fedorapeople.org/dhcp/ldap-patch/ldap-for-dhcp-%{ldappatchver}.tar.gz
|
||||
Source2: dhcpd.init
|
||||
Source3: dhcrelay.init
|
||||
Source4: dhclient-script
|
||||
@ -106,7 +109,7 @@ libdhcpctl and libomapi static libraries are also included in this package.
|
||||
%setup -T -D -a 1
|
||||
|
||||
# Add in LDAP support
|
||||
%{__patch} -p1 < ldap-for-dhcp-%{version}-2/%{name}-%{version}-ldap.patch
|
||||
%{__patch} -p1 < ldap-for-dhcp-%{ldappatchver}/%{name}-%{version}-ldap.patch
|
||||
|
||||
# Replace the standard ISC warning message about requesting help with an
|
||||
# explanation that this is a patched build of ISC DHCP and bugs should be
|
||||
@ -185,7 +188,7 @@ libdhcpctl and libomapi static libraries are also included in this package.
|
||||
%patch18 -p1
|
||||
|
||||
# Copy in documentation and example scripts for LDAP patch to dhcpd
|
||||
%{__install} -p -m 0755 ldap-for-dhcp-%{version}/dhcpd-conf-to-ldap contrib/
|
||||
%{__install} -p -m 0755 ldap-for-dhcp-%{ldappatchver}/dhcpd-conf-to-ldap contrib/
|
||||
|
||||
# Copy in the Fedora/RHEL dhclient script
|
||||
%{__install} -p -m 0755 %{SOURCE4} client/scripts/linux
|
||||
@ -311,7 +314,7 @@ EOF
|
||||
|
||||
# Install dhcp.schema for LDAP configuration
|
||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/openldap/schema
|
||||
%{__install} -p -m 0644 -D ldap-for-dhcp-%{version}/dhcp.schema \
|
||||
%{__install} -p -m 0644 -D ldap-for-dhcp-%{ldappatchver}/dhcp.schema \
|
||||
%{buildroot}%{_sysconfdir}/openldap/schema
|
||||
|
||||
# Install empty directory for dhclient.d scripts
|
||||
@ -365,9 +368,9 @@ fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE README ldap-for-dhcp-%{version}/README.ldap
|
||||
%doc LICENSE README ldap-for-dhcp-%{ldappatchver}/README.ldap
|
||||
%doc RELNOTES dhcpd.conf.sample doc/IANA-arp-parameters doc/api+protocol
|
||||
%doc doc/*.txt __fedora_contrib/* ldap-for-dhcp-%{version}/*.txt
|
||||
%doc doc/*.txt __fedora_contrib/* ldap-for-dhcp-%{ldappatchver}/*.txt
|
||||
%dir %{_localstatedir}/lib/dhcpd
|
||||
%dir %{dhcpconfdir}
|
||||
%verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/dhcpd/dhcpd.leases
|
||||
|
Loading…
Reference in New Issue
Block a user