- Init script fixes (#237985, #237983)

- Reference correct scripts in dhclient-script.8 man page (#238036)
This commit is contained in:
David Cantrell 2007-04-26 19:01:43 +00:00
parent bf55f11dd7
commit 9c81a8e004
4 changed files with 136 additions and 171 deletions

View File

@ -1,5 +1,5 @@
--- dhcp-3.0.5/client/dhclient-script.8.manpages 2005-09-28 15:17:08.000000000 -0400 --- dhcp-3.0.5/client/dhclient-script.8.manpages 2005-09-28 15:17:08.000000000 -0400
+++ dhcp-3.0.5/client/dhclient-script.8 2007-03-29 14:55:09.000000000 -0400 +++ dhcp-3.0.5/client/dhclient-script.8 2007-04-26 14:52:13.000000000 -0400
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
exit hooks provided (see HOOKS for details). These hooks will allow the exit hooks provided (see HOOKS for details). These hooks will allow the
user to override the default behaviour of the client in creating a user to override the default behaviour of the client in creating a
@ -20,7 +20,7 @@
+.B ETCDIR/dhclient-up-hooks +.B ETCDIR/dhclient-up-hooks
+script, and source it if found. This script can handle DHCP options in +script, and source it if found. This script can handle DHCP options in
+the environment that are not handled by default. A per-interface +the environment that are not handled by default. A per-interface
+.B ETCDIR/dhclient-up-${IF}-hooks +.B ETCDIR/dhclient-${IF}-up-hooks
+script will override the generic script and be sourced when interface +script will override the generic script and be sourced when interface
+$IF has been brought up. +$IF has been brought up.
+.PP +.PP
@ -30,7 +30,7 @@
+.B ETCDIR/dhclient-down-hooks +.B ETCDIR/dhclient-down-hooks
+script, and source it if found. This script can handle DHCP options in +script, and source it if found. This script can handle DHCP options in
+the environment that are not handled by default. A per-interface +the environment that are not handled by default. A per-interface
+.B ETCDIR/dhclient-down-${IF}-hooks +.B ETCDIR/dhclient-${IF}-down-hooks
+script will override the generic script and be sourced when interface +script will override the generic script and be sourced when interface
+$IF is about to be brought down. +$IF is about to be brought down.
+ +
@ -38,7 +38,7 @@
When dhclient needs to invoke the client configuration script, it When dhclient needs to invoke the client configuration script, it
defines a set of variables in the environment, and then invokes defines a set of variables in the environment, and then invokes
--- dhcp-3.0.5/client/dhclient.conf.5.manpages 2005-06-16 15:40:13.000000000 -0400 --- dhcp-3.0.5/client/dhclient.conf.5.manpages 2005-06-16 15:40:13.000000000 -0400
+++ dhcp-3.0.5/client/dhclient.conf.5 2007-03-29 14:55:21.000000000 -0400 +++ dhcp-3.0.5/client/dhclient.conf.5 2007-04-26 14:51:02.000000000 -0400
@@ -185,7 +185,8 @@ @@ -185,7 +185,8 @@
options. Only the option names should be specified in the request options. Only the option names should be specified in the request
statement - not option parameters. By default, the DHCP server statement - not option parameters. By default, the DHCP server
@ -68,8 +68,8 @@
.SH SAMPLE .SH SAMPLE
The following configuration file is used on a laptop running NetBSD The following configuration file is used on a laptop running NetBSD
1.3. The laptop has an IP alias of 192.5.5.213, and has one 1.3. The laptop has an IP alias of 192.5.5.213, and has one
--- dhcp-3.0.5/client/dhclient.8.manpages 2007-03-29 14:54:16.000000000 -0400 --- dhcp-3.0.5/client/dhclient.8.manpages 2007-04-26 14:51:02.000000000 -0400
+++ dhcp-3.0.5/client/dhclient.8 2007-03-29 14:58:16.000000000 -0400 +++ dhcp-3.0.5/client/dhclient.8 2007-04-26 14:51:02.000000000 -0400
@@ -85,6 +85,28 @@ @@ -85,6 +85,28 @@
.B -x .B -x
] ]
@ -208,7 +208,7 @@
The syntax of the dhclient.conf(5) file is discussed separately. The syntax of the dhclient.conf(5) file is discussed separately.
.SH OMAPI .SH OMAPI
--- dhcp-3.0.5/common/dhcp-options.5.manpages 2006-04-26 11:12:43.000000000 -0400 --- dhcp-3.0.5/common/dhcp-options.5.manpages 2006-04-26 11:12:43.000000000 -0400
+++ dhcp-3.0.5/common/dhcp-options.5 2007-03-29 14:58:42.000000000 -0400 +++ dhcp-3.0.5/common/dhcp-options.5 2007-04-26 14:51:02.000000000 -0400
@@ -834,6 +834,24 @@ @@ -834,6 +834,24 @@
classless IP routing is now the most widely deployed routing standard, classless IP routing is now the most widely deployed routing standard,
this option is virtually useless, and is not implemented by any of the this option is virtually useless, and is not implemented by any of the
@ -235,7 +235,7 @@
.PP .PP
.nf .nf
--- dhcp-3.0.5/dhcpctl/dhcpctl.3.manpages 2004-09-24 17:08:38.000000000 -0400 --- dhcp-3.0.5/dhcpctl/dhcpctl.3.manpages 2004-09-24 17:08:38.000000000 -0400
+++ dhcp-3.0.5/dhcpctl/dhcpctl.3 2007-03-29 14:59:16.000000000 -0400 +++ dhcp-3.0.5/dhcpctl/dhcpctl.3 2007-04-26 14:51:02.000000000 -0400
@@ -43,7 +43,8 @@ @@ -43,7 +43,8 @@
.\" .\"
.\" .\"
@ -256,7 +256,7 @@
int main (int argc, char **argv) { int main (int argc, char **argv) {
dhcpctl_data_string ipaddrstring = NULL; dhcpctl_data_string ipaddrstring = NULL;
--- dhcp-3.0.5/server/dhcpd.conf.5.manpages 2006-07-09 11:02:24.000000000 -0400 --- dhcp-3.0.5/server/dhcpd.conf.5.manpages 2006-07-09 11:02:24.000000000 -0400
+++ dhcp-3.0.5/server/dhcpd.conf.5 2007-03-29 14:58:59.000000000 -0400 +++ dhcp-3.0.5/server/dhcpd.conf.5 2007-04-26 14:51:02.000000000 -0400
@@ -531,9 +531,9 @@ @@ -531,9 +531,9 @@
failover peer "foo" { failover peer "foo" {
primary; primary;

View File

@ -10,7 +10,7 @@
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
Name: dhcp Name: dhcp
Version: 3.0.5 Version: 3.0.5
Release: 33%{?dist} Release: 34%{?dist}
Epoch: 12 Epoch: 12
License: ISC License: ISC
Group: System Environment/Daemons Group: System Environment/Daemons
@ -429,6 +429,10 @@ fi
%{_libdir}/libdhcp4client.a %{_libdir}/libdhcp4client.a
%changelog %changelog
* Thu Apr 26 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-34
- Init script fixes (#237985, #237983)
- Reference correct scripts in dhclient-script.8 man page (#238036)
* Fri Apr 20 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-33 * Fri Apr 20 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-33
- Rename -devel-static packages to -static (#225691) - Rename -devel-static packages to -static (#225691)

View File

@ -1,92 +1,67 @@
#!/bin/sh #!/bin/bash
#
# dhcpd This shell script takes care of starting and stopping
# dhcpd.
# #
# chkconfig: - 65 35 # chkconfig: - 65 35
# description: dhcpd provide access to Dynamic Host Control Protocol. # description: dhcpd provide access to Dynamic Host Control Protocol.
# Source function library. # Source function library.
. /etc/rc.d/init.d/functions . /etc/init.d/functions
RETVAL=0
prog=dhcpd
dhcpd=/usr/sbin/dhcpd
lockfile=/var/lock/subsys/dhcpd
# Source networking configuration.
. /etc/sysconfig/network
. /etc/sysconfig/dhcpd . /etc/sysconfig/dhcpd
# Check that networking is up. cfOption() {
[ ${NETWORKING} = "no" ] && exit 0 let i=0
for a in $* ; do
[ -f /usr/sbin/dhcpd ] || exit 0 ((++i))
cfOption()
{ let i=0;
for a in $*;
do ((++i));
if [ $a = -cf ]; then if [ $a = -cf ]; then
((++i)); ((++i))
eval 'echo $'$i; eval 'echo $'$i
elif [[ $a = -cf* ]]; then elif [[ $a = -cf* ]]; then
echo ${a#-cf}; echo ${a#-cf}
fi; fi
done; done
} }
CF=`cfOption $DHCPDARGS` CF=`cfOption $DHCPDARGS`
if [ -z "$CF" ]; then if [ -z "$CF" ]; then
CF='/etc/dhcpd.conf'; CF='/etc/dhcpd.conf'
fi fi
[ -f "$CF" ] || exit 0 [ -f "$CF" ] || exit 0
if [ ! -f /var/lib/dhcpd/dhcpd.leases ] ; then if [ ! -f /var/lib/dhcpd/dhcpd.leases ] ; then
mkdir -p /var/lib/dhcpd mkdir -p /var/lib/dhcpd
touch /var/lib/dhcpd/dhcpd.leases touch /var/lib/dhcpd/dhcpd.leases
[ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases >/dev/null 2>&1 [ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases >/dev/null 2>&1
fi fi
RETVAL=0 configtest() {
prog="dhcpd" [ -x $dhcpd ] || return 5
[ -f $CF ] || return 6
configtest() $dhcpd -q -t -cf $CF
{ RETVAL=$?
/usr/sbin/dhcpd -q -t -cf $CF return $RETVAL
return $?
} }
start() { start() {
# Start daemons. [ -x $dhcpd ] || return 5
[ -f $CF ] || return 6
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
daemon /usr/sbin/dhcpd ${DHCPDARGS} 2>/dev/null daemon $dhcpd $DHCPDARGS 2>/dev/null
RETVAL=$? RETVAL=$?
echo [ $RETVAL = 0 ] && touch $lockfile
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/dhcpd
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd startup succeeded'
fi;
else
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd startup failed'
fi;
fi
return $RETVAL return $RETVAL
} }
stop() { stop() {
# Stop daemons.
echo -n $"Shutting down $prog: " echo -n $"Shutting down $prog: "
killproc dhcpd killproc $prog -TERM
RETVAL=$? RETVAL=$?
echo [ $RETVAL = 0 ] && rm -f $lockfile
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/dhcpd
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd shutdown succeeded'
fi;
else
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd shutdown failed'
fi;
fi
return $RETVAL return $RETVAL
} }
@ -98,17 +73,18 @@ case "$1" in
stop) stop)
stop stop
;; ;;
restart|reload) reload)
RETVAL=3
;;
restart)
configtest || exit $? configtest || exit $?
stop stop
start start
RETVAL=$?
;; ;;
condrestart) condrestart)
if [ -f /var/lock/subsys/dhcpd ]; then if [ -f $lockfile ]; then
stop stop
start start
RETVAL=$?
fi fi
;; ;;
configtest|check|testconfig|test) configtest|check|testconfig|test)
@ -116,13 +92,13 @@ case "$1" in
RETVAL=$? RETVAL=$?
;; ;;
status) status)
status dhcpd status $prog
RETVAL=$? RETVAL=$?
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condrestart|configtest|status}" echo $"Usage: $0 {start|stop|restart|condrestart|configtest|status}"
exit 1 RETVAL=3
;;
esac esac
exit $RETVAL exit $RETVAL

View File

@ -1,52 +1,35 @@
#!/bin/sh #!/bin/bash
#
# dhcrelay This shell script takes care of starting and stopping
# dhcrelay.
# #
# chkconfig: - 66 34 # chkconfig: - 66 34
# description: dhcrelay provides a relay for Dynamic Host Control Protocol. # description: dhcrelay provides a relay for Dynamic Host Control Protocol.
# Source function library. # Source function library
. /etc/rc.d/init.d/functions . /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Source dhcrelay configuration. We can't default a DHCPSERVERS entry!
if [ -f /etc/sysconfig/dhcrelay ] ; then
. /etc/sysconfig/dhcrelay
[ -n "$DHCPSERVERS" ] || exit 0
else
exit 0
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/dhcrelay ] || exit 0
RETVAL=0 RETVAL=0
prog="dhcrelay" prog=dhcrelay
dhcrelay=/usr/sbin/dhcrelay
lockfile=/var/lock/subsys/dhcrelay
start() { start() {
# Start daemons. [ -x $dhcrelay ] || exit 5
[ -f /etc/sysconfig/dhcrelay ] || exit 6
. /etc/sysconfig/dhcrelay
[ -z "$DHCPSERVERS" ] && exit 6
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
daemon /usr/sbin/dhcrelay \ daemon $dhcrelay $([ -n "$INTERFACES" ] && for int in $INTERFACES ; do echo -n " -i $int" ; done) $DHCPSERVERS
$([ -n "$INTERFACES" ] && for int in $INTERFACES ; do echo -n " -i $int" ; done) \
$DHCPSERVERS
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay [ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL return $RETVAL
} }
stop() { stop() {
# Stop daemons.
echo -n $"Shutting down $prog: " echo -n $"Shutting down $prog: "
killproc dhcrelay killproc $prog -TERM
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay [ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL return $RETVAL
} }
@ -58,25 +41,27 @@ case "$1" in
stop) stop)
stop stop
;; ;;
restart|reload) reload)
RETVAL=3
;;
restart)
stop stop
start start
RETVAL=$?
;; ;;
condrestart) condrestart)
if [ -f /var/lock/subsys/dhcrelay ]; then if [ -f $lockfile ]; then
stop stop
start start
RETVAL=$?
fi fi
;; ;;
status) status)
status dhcrelay status $prog
RETVAL=$? RETVAL=$?
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|condrestart|status}" echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1 RETVAL=3
;;
esac esac
exit $RETVAL exit $RETVAL