[dhcp] revert change made in 4.2.3-3 because of failing failover (#765967)
Jiří Popelka
jpopelka at fedoraproject.org
Wed Jan 4 17:14:23 UTC 2012
commit 0acc1b8c2c6de469e25850a703b54f30827560d1
Author: Jiri Popelka <jpopelka at redhat.com>
Date: Tue Dec 20 18:26:43 2011 +0100
revert change made in 4.2.3-3 because of failing failover (#765967)
don't need to fix lease files ownership before starting service
dhclient-script: allow static route with a 0.0.0.0 next-hop addressi (#769463
dhclient-script | 11 ++++---
dhcp-4.2.3-paranoia.patch | 71 +++-----------------------------------------
dhcp.spec | 10 +++++-
dhcpd.service | 3 --
dhcpd6.service | 3 --
5 files changed, 19 insertions(+), 79 deletions(-)
---
diff --git a/dhclient-script b/dhclient-script
index a788cf9..99196a9 100644
--- a/dhclient-script
+++ b/dhclient-script
@@ -405,7 +405,10 @@ dhconfig() {
fi
gateway=${static_routes[$i+1]}
- if is_router_reachable ${gateway}; then
+ # special case 0.0.0.0 to allow static routing for link-local addresses
+ # (including IPv4 multicast) which will not have a next-hop (#769463)
+ if [ "${gateway}" = "0.0.0.0" ] ||
+ is_router_reachable ${gateway}; then
metric=''
for t in ${route_targets[@]}; do
if [ ${t} = ${target} ]; then
@@ -434,11 +437,9 @@ dhconfig() {
# gateways
if [[ ( "${DEFROUTE}" != "no" ) &&
- (( -z "${GATEWAYDEV}" ) ||
- ( "${GATEWAYDEV}" = "${interface}" )) ]]; then
+ (( -z "${GATEWAYDEV}" ) || ( "${GATEWAYDEV}" = "${interface}" )) ]]; then
if [[ ( -z "$GATEWAY" ) ||
- (( -n "$DHCLIENT_IGNORE_GATEWAY" ) &&
- ( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* )) ]]; then
+ (( -n "$DHCLIENT_IGNORE_GATEWAY" ) && ( "$DHCLIENT_IGNORE_GATEWAY" = [Yy]* )) ]]; then
metric="${METRIC:-}"
let i="${METRIC:-0}"
default_routers=()
diff --git a/dhcp-4.2.3-paranoia.patch b/dhcp-4.2.3-paranoia.patch
index 4139ce9..e6c1576 100644
--- a/dhcp-4.2.3-paranoia.patch
+++ b/dhcp-4.2.3-paranoia.patch
@@ -1,48 +1,7 @@
-diff -up dhcp-4.2.3/server/dhcpd.c.paranoia dhcp-4.2.3/server/dhcpd.c
---- dhcp-4.2.3/server/dhcpd.c.paranoia 2011-10-26 19:10:08.162925489 +0200
-+++ dhcp-4.2.3/server/dhcpd.c 2011-10-26 19:12:34.541095509 +0200
-@@ -699,11 +699,11 @@ main(int argc, char **argv) {
-
- group_write_hook = group_writer;
-
-- /* Start up the database... */
-- db_startup (lftest);
--
-- if (lftest)
-+ if (lftest) {
-+ /* Start up the database... */
-+ db_startup (lftest);
- exit (0);
-+ }
-
- /* Discover all the network interfaces and initialize them. */
- discover_interfaces(DISCOVER_SERVER);
-@@ -743,24 +743,6 @@ main(int argc, char **argv) {
- #if defined (TRACING)
- trace_seed_stash (trace_srandom, seed + cur_time);
- #endif
-- postdb_startup ();
--
--#ifdef DHCPv6
-- /*
-- * Set server DHCPv6 identifier.
-- * See dhcpv6.c for discussion of setting DUID.
-- */
-- if (set_server_duid_from_option() == ISC_R_SUCCESS) {
-- write_server_duid();
-- } else {
-- if (!server_duid_isset()) {
-- if (generate_new_server_duid() != ISC_R_SUCCESS) {
-- log_fatal("Unable to set server identifier.");
-- }
-- write_server_duid();
-- }
-- }
--#endif /* DHCPv6 */
-
- #ifndef DEBUG
- if (daemon) {
-@@ -771,22 +753,6 @@ main(int argc, char **argv) {
+diff -up dhcp-4.2.3-P1/server/dhcpd.c.paranoia dhcp-4.2.3-P1/server/dhcpd.c
+--- dhcp-4.2.3-P1/server/dhcpd.c.paranoia 2011-12-20 18:02:26.000000000 +0100
++++ dhcp-4.2.3-P1/server/dhcpd.c 2011-12-20 18:03:43.840037108 +0100
+@@ -771,22 +771,6 @@ main(int argc, char **argv) {
exit (0);
}
@@ -65,7 +24,7 @@ diff -up dhcp-4.2.3/server/dhcpd.c.paranoia dhcp-4.2.3/server/dhcpd.c
/*
* Deal with pid files. If the user told us
* not to write a file we don't read one either
-@@ -823,6 +789,42 @@ main(int argc, char **argv) {
+@@ -823,6 +807,22 @@ main(int argc, char **argv) {
}
}
@@ -85,26 +44,6 @@ diff -up dhcp-4.2.3/server/dhcpd.c.paranoia dhcp-4.2.3/server/dhcpd.c
+ }
+#endif /* PARANOIA */
+
-+ db_startup(lftest);
-+ postdb_startup ();
-+
-+#ifdef DHCPv6
-+ /*
-+ * Set server DHCPv6 identifier.
-+ * See dhcpv6.c for discussion of setting DUID.
-+ */
-+ if (set_server_duid_from_option() == ISC_R_SUCCESS) {
-+ write_server_duid();
-+ } else {
-+ if (!server_duid_isset()) {
-+ if (generate_new_server_duid() != ISC_R_SUCCESS) {
-+ log_fatal("Unable to set server identifier.");
-+ }
-+ write_server_duid();
-+ }
-+ }
-+#endif /* DHCPv6 */
-+
/* If we were requested to log to stdout on the command line,
keep doing so; otherwise, stop. */
if (log_perror == -1)
diff --git a/dhcp.spec b/dhcp.spec
index 9657ec6..fc643dd 100644
--- a/dhcp.spec
+++ b/dhcp.spec
@@ -22,7 +22,7 @@
Summary: Dynamic host configuration protocol software
Name: dhcp
Version: 4.2.3
-Release: 10.%{patchver}%{?dist}
+Release: 11.%{patchver}%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and
# that's why it is at 12 now. It should have never been used, but it was.
@@ -313,7 +313,6 @@ rm bind/bind.tar.gz
# Write PID file BEFORE changing of the effective user/group ID.
# (Submitted to dhcp-bugs at isc.org - [ISC-Bugs #25806])
-# Write lease file AFTER changing of the effective user/group ID.
%patch32 -p1 -b .paranoia
# IPoIB support (#660681)
@@ -659,6 +658,13 @@ fi
%changelog
+* Wed Dec 21 2011 Jiri Popelka <jpopelka at redhat.com> - 12:4.2.3-11.P1
+- revert change made in 4.2.3-3 because of failing failover inicialization (#765967)
+ the procedure is now:
+ init lease file, init failover, init PID file, change effective user/group ID
+- don't need to fix lease files ownership before starting service
+- dhclient-script: allow static route with a 0.0.0.0 next-hop address (#769463)
+
* Tue Dec 20 2011 Jiri Popelka <jpopelka at redhat.com> - 12:4.2.3-10.P1
- hopefully we don't need 12-dhcpd anymore as 'After=network.target'
in dhcpd[6].service should take care of the original problem (#565921)
diff --git a/dhcpd.service b/dhcpd.service
index 493c351..c9a73a1 100644
--- a/dhcpd.service
+++ b/dhcpd.service
@@ -4,9 +4,6 @@ After=syslog.target network.target
[Service]
EnvironmentFile=/etc/sysconfig/dhcpd
-# For the case where /var/lib/dhcpd/dhcpd.leases is owned by root:root as a
-# consequence of running dhcpd without '-user dhcpd -group dhcpd'
-ExecStartPre=/bin/chown -R dhcpd:dhcpd /var/lib/dhcpd/
ExecStart=/usr/sbin/dhcpd -d -user dhcpd -group dhcpd --no-pid $DHCPDARGS
[Install]
diff --git a/dhcpd6.service b/dhcpd6.service
index 028d5a1..ddaa104 100644
--- a/dhcpd6.service
+++ b/dhcpd6.service
@@ -4,9 +4,6 @@ After=syslog.target network.target
[Service]
EnvironmentFile=/etc/sysconfig/dhcpd6
-# For the case where /var/lib/dhcpd/dhcpd6.leases is owned by root:root as a
-# consequence of running dhcpd without '-user dhcpd -group dhcpd'
-ExecStartPre=/bin/chown -R dhcpd:dhcpd /var/lib/dhcpd/
ExecStart=/usr/sbin/dhcpd -d -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS
[Install]
More information about the scm-commits
mailing list