diff --git a/0001-adjust-LINKDELAY-when-STP-is-on.patch b/0001-adjust-LINKDELAY-when-STP-is-on.patch new file mode 100644 index 0000000..81997a3 --- /dev/null +++ b/0001-adjust-LINKDELAY-when-STP-is-on.patch @@ -0,0 +1,63 @@ +From 9aae1ad52d7e92d4819ae0ee861e4ac7add39316 Mon Sep 17 00:00:00 2001 +From: Laine Stump +Date: Tue, 11 Nov 2014 14:13:22 -0500 +Subject: [PATCH] adjust LINKDELAY when STP is on + +This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162822 + +When ifup is called on an interface that has BOOTPROTO=dhcp, ifup-eth +will call network-functions:check_link_down() to wait for carrier on +the interface before starting dhclient. If the interface happens to be +a bridge device, carrier will not come on until at least one attached +device is in "forwarding" mode. If the bridge has STP enabled, it +takes at least $DELAY * 2 + 5 seconds (sometimes slightly longer) for +any attached device to go into forwarding mode. + +However, check_link_down() will only wait for max(${LINKDELAY}, 5) +seconds for carrier, and there are *many* existing configs that have +STP enabled but no setting for LINKDELAY. Every one of those configs +will now fail to ifup the bridge device. + +The solution implemented in this patch is for ifup-eth to set +LINKDELAY to at least ${DELAY} * 2 + 7 when the device is a bridge an +STP is enabled. Since check_link_down() returns within .5 sec of +carrier coming up, the worst effect this could have would be to take +longer to fail in the case of a config where carrier was *never* going +to come up. Otherwise, it will not create any more delay than is +already present in cases that currently work, and will cause many +other configs to become unbroken. +--- + sysconfig/network-scripts/ifup-eth | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth +index 8be5bff..078c7c4 100755 +--- a/sysconfig/network-scripts/ifup-eth ++++ b/sysconfig/network-scripts/ifup-eth +@@ -1,6 +1,6 @@ + #!/bin/bash + # Network Interface Configuration System +-# Copyright (c) 1996-2010 Red Hat, Inc. all rights reserved. ++# Copyright (c) 1996-2014 Red Hat, Inc. all rights reserved. + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License, version 2, +@@ -62,6 +62,15 @@ if [ "${TYPE}" = "Bridge" ]; then + value=${arg##*=}; + echo $value > /sys/class/net/${DEVICE}/bridge/$key + done ++ # set LINKDELAY (used as timeout when calling check_link_down()) ++ # to at least (${DELAY} * 2) + 7 if STP is enabled. This is the ++ # minimum time required for /sys/class/net/$REALDEVICE/carrier to ++ # become 1 after "ip link set dev $DEVICE up" is called. ++ if [ "${STP}" = "yes" -o "${STP}" = "on" ]; then ++ TMPD=7 ++ [ -n "${DELAY}" ] && TMPD=$(expr ${DELAY} \* 2 + ${TMPD}) ++ [ 0$LINKDELAY -lt $TMPD ] && LINKDELAY=$TMPD ++ fi + fi + + # Create tap device. +-- +1.8.3.1 + diff --git a/0001-fedora-domainname-DefaultDependencies-no.patch b/0001-fedora-domainname-DefaultDependencies-no.patch new file mode 100644 index 0000000..4a1935c --- /dev/null +++ b/0001-fedora-domainname-DefaultDependencies-no.patch @@ -0,0 +1,25 @@ +From fc38d5eead7a1477c6fe580b224c7a6e113d52fe Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Mon, 3 Mar 2014 16:11:33 +0100 +Subject: [PATCH 1/4] fedora-domainname: DefaultDependencies=no + +--- + systemd/system/fedora-domainname.service | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/systemd/system/fedora-domainname.service b/systemd/system/fedora-domainname.service +index e501a13..d5e0ff5 100644 +--- a/systemd/system/fedora-domainname.service ++++ b/systemd/system/fedora-domainname.service +@@ -1,6 +1,8 @@ + [Unit] + Description=Read and set NIS domainname from /etc/sysconfig/network + Before=ypbind.service yppasswdd.service ypserv.service ypxfrd.service ++DefaultDependencies=no ++Conflicts=shutdown.target + + [Service] + ExecStart=/lib/systemd/fedora-domainname +-- +1.8.5.3 + diff --git a/initscripts.spec b/initscripts.spec index cc4842d..fdacf33 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -4,9 +4,11 @@ Version: 9.51 # ppp-watch is GPLv2+, everything else is GPLv2 License: GPLv2 and GPLv2+ Group: System Environment/Base -Release: 1%{?dist} +Release: 3%{?dist} URL: http://fedorahosted.org/releases/i/n/initscripts/ Source: http://fedorahosted.org/releases/i/n/initscripts/initscripts-%{version}.tar.bz2 +Patch0: 0001-fedora-domainname-DefaultDependencies-no.patch +Patch1: 0001-adjust-LINKDELAY-when-STP-is-on.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Obsoletes: initscripts-legacy <= 9.39 Requires: /bin/awk, sed, coreutils @@ -55,6 +57,9 @@ Currently, this consists of various memory checking code. %prep %setup -q +%patch0 -p1 +%patch1 -p1 + %build make @@ -219,6 +224,12 @@ rm -rf $RPM_BUILD_ROOT /etc/profile.d/debug* %changelog +* Wed Nov 12 2014 Lukáš Nykrýn - 9.51.3 +- adjust LINKDELAY when STP is on (#1162822) + +* Wed Mar 26 2014 Lukáš Nykrýn - 9.51-2 +- fedora-domainname service should use DefaultDependencies=no + * Tue Jan 14 2014 Lukáš Nykrýn 9.51-1 - readonly-root: bind-mount only necessary subset of entries in rwtab - readonly-root: Add /var/log/audit/audit.log to rwtab