From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QbPbi-0004kd-6R for garchives@archives.gentoo.org; Tue, 28 Jun 2011 04:09:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 69C371C004; Tue, 28 Jun 2011 04:08:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 338EF1C004 for ; Tue, 28 Jun 2011 04:08:52 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ADF131B401A for ; Tue, 28 Jun 2011 04:08:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CC1698003C for ; Tue, 28 Jun 2011 04:08:50 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: net/ X-VCS-Repository: proj/openrc X-VCS-Files: net/ccwgroup.sh X-VCS-Directories: net/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: c427d3c1fec89f6a9281dccdc123bad73af80804 Date: Tue, 28 Jun 2011 04:08:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: cfe537ee1f607a3be03b289394b77ab6 commit: c427d3c1fec89f6a9281dccdc123bad73af80804 Author: Mike Frysinger gentoo org> AuthorDate: Tue Jun 28 04:02:11 2011 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Jun 28 04:02:11 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Dc427d3c1 net: ccwgroup: smooth up/down process We need to bring the link up ourselves after we've properly configured the device. The common code tries to bring the link up itself, but it does so before things are configured, and so it ends up failing. When shutting down, we need to wait for the kernel to finish destroying the interface. Otherwise, when doing a restart, openrc is quick enough to tell the kernel to destroy things, but then start trying to bring it back up before the kernel has finished. X-Gentoo-Bug: 367467 X-Gentoo-Bug-URL: http://bugs.gentoo.org/367467 Signed-off-by: Mike Frysinger gentoo.org> --- net/ccwgroup.sh | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/net/ccwgroup.sh b/net/ccwgroup.sh index 248b159..60cd25f 100644 --- a/net/ccwgroup.sh +++ b/net/ccwgroup.sh @@ -58,6 +58,11 @@ ccwgroup_pre_start() echo "${val}" > /sys/devices/${ccw_type}/${first}/${var} done eend $? + + # Now that we've properly configured the device, we can run + # bring the interface up. Common code tried to do this already, + # but it failed because we didn't setup sysfs yet. + _up } =20 ccwgroup_pre_stop() @@ -88,9 +93,14 @@ ccwgroup_post_stop() local device=3D"$(service_get_value ccwgroup_device)" [ -z "${device}" ] && return 0 local ccw_type=3D"$(service_get_value ccwgroup_type)" + local path=3D"/sys/devices/${ccw_type}/${device}" =20 einfo "Disabling ccwgroup/${ccw_type} on ${IFACE}" - echo "0" >/sys/devices/${ccw_type}/"${device}"/online - echo "1" >/sys/devices/${ccw_type}/"${device}"/ungroup + if echo "0" >"${path}"/online && + echo "1" >"${path}"/ungroup ; then + # The device doesn't disappear right away which breaks + # restart, or a quick start up, so wait around. + while [ -e "${path}" ] ; do :; done + fi eend $? }