- Honor options from /etc/sysconfig/network for blocking until network is

up
This commit is contained in:
Daniel Williams 2008-04-16 19:39:54 +00:00
parent 97d41da55d
commit a2e8f79df4
2 changed files with 51 additions and 1 deletions

View File

@ -16,7 +16,7 @@ Name: NetworkManager
Summary: Network connection manager and user applications
Epoch: 1
Version: 0.7.0
Release: 0.9.1.%{snapshot}%{?dist}
Release: 0.9.2.%{snapshot}%{?dist}
Group: System Environment/Base
License: GPLv2+
URL: http://www.gnome.org/projects/NetworkManager/
@ -25,6 +25,7 @@ Source1: nm-applet-%{version}.%{applet_snapshot}.tar.gz
Source2: nm-system-settings.conf
Patch1: NetworkManager-0.6.5-fixup-internal-applet-build.patch
Patch2: no-strict-aliasing.patch
Patch3: optionally-wait-for-network.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
PreReq: chkconfig
@ -137,6 +138,7 @@ NetworkManager functionality from applications that use glib.
tar -xzf %{SOURCE1}
%patch1 -p1 -b .buildfix
%patch2 -p1 -b .no-strict-aliasing
%patch3 -p1 -b .wait-for-network
%build
# Even though we don't require named, we still build with it
@ -285,6 +287,9 @@ fi
%changelog
* Wed Apr 16 2008 Dan Williams <dcbw@redhat.com> - 1:0.7.0-0.9.2.svn3566
- Honor options from /etc/sysconfig/network for blocking until network is up
* Wed Apr 16 2008 Dan Williams <dcbw@redhat.com> - 1:0.7.0-0.9.1.svn3566
- Turn on Add/Edit in the connection editor
- Don't flush or change IPv6 addresses or routes

View File

@ -0,0 +1,45 @@
--- NetworkManager-0.7.0/initscript/RedHat/NetworkManager.in 2008-04-05 12:17:55.000000000 -0400
+++ NetworkManager-0.7.0/initscript/RedHat/NetworkManager.in 2008-04-16 13:10:41.000000000 -0400
@@ -2,7 +2,7 @@
#
# NetworkManager: NetworkManager daemon
#
-# chkconfig: - 98 02
+# chkconfig: - 27 73
# description: This is a daemon for automatically switching network \
# connections to the best available connection.
#
@@ -10,7 +10,7 @@
# pidfile: /var/run/NetworkManager/NetworkManager.pid
#
### BEGIN INIT INFO
-# Provides: network_manager
+# Provides: network_manager $network
# Required-Start: $local_fs messagebus haldaemon
# Required-Stop: $local_fs messagebus haldaemon
# Default-Start: 3 4 5
@@ -34,6 +34,9 @@
# Source function library.
. /etc/rc.d/init.d/functions
+# Source network configuration
+. /etc/sysconfig/network
+
# so we can rearrange this easily
processname=NetworkManager
servicename=NetworkManager
@@ -50,6 +53,14 @@
daemon --check $servicename $processname --pid-file=$pidfile
RETVAL=$?
echo
+ if [ -n "${NETWORKWAIT}" ]; then
+ [ -z "${LINKDELAY}" ] && LINKDELAY=10
+ echo -n $"Waiting for network..."
+ nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30
+ [ "$?" = "0" ] && success "network startup" || failure "network startup"
+ echo
+ [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY}
+ fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
}