/[gentoo-x86]/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch
Gentoo

Diff of /net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
1From e99873e7583a3838e0873b1d0b1f9c3dac49f853 Mon Sep 17 00:00:00 2001 1From 705b9978ed914aba87e5a5191a1d0acacaf70a81 Mon Sep 17 00:00:00 2001
2From: Alexandre Rostovtsev <tetromino@gentoo.org> 2From: Alexandre Rostovtsev <tetromino@gentoo.org>
3Date: Wed, 1 Feb 2012 05:51:20 -0500 3Date: Wed, 1 Feb 2012 05:51:20 -0500
4Subject: [PATCH] gentoo: provide net and use inactive status when not 4Subject: [PATCH] gentoo: provide net and use inactive status when not
5 connected 5 connected
6 6
7The status will be reset to started via a dispatcher script on up/down 7The status will be reset to started via a dispatcher script on up/down
8events. See https://bugs.gentoo.org/show_bug.cgi?id=252137 8events. See https://bugs.gentoo.org/show_bug.cgi?id=252137
9--- 9---
10 initscript/Gentoo/NetworkManager.in | 22 +++++++++++++++++++++- 10 initscript/Gentoo/NetworkManager.in | 26 +++++++++++++++++++++++++-
11 1 files changed, 21 insertions(+), 1 deletions(-) 11 1 files changed, 25 insertions(+), 1 deletions(-)
12 12
13diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in 13diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in
14index 7db410b..34f19b1 100755 14index 7db410b..1960795 100755
15--- a/initscript/Gentoo/NetworkManager.in 15--- a/initscript/Gentoo/NetworkManager.in
16+++ b/initscript/Gentoo/NetworkManager.in 16+++ b/initscript/Gentoo/NetworkManager.in
17@@ -3,18 +3,38 @@ 17@@ -3,18 +3,42 @@
18 # Distributed under the terms of the GNU General Purpose License v2 18 # Distributed under the terms of the GNU General Purpose License v2
19 # $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch,v 1.1 2012/02/20 09:24:59 tetromino Exp $ 19 # $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch,v 1.2 2012/02/21 23:19:19 tetromino Exp $
20 20
21+description="NetworkManager daemon. The service is marked as started only \ 21+description="NetworkManager daemon. The service is marked as started only \
22+when a network connection is established." 22+when a network connection is established."
23+ 23+
24 depend() { 24 depend() {
29 start() { 29 start() {
30+ # If we are re-called by a dispatcher event, we want to mark the service 30+ # If we are re-called by a dispatcher event, we want to mark the service
31+ # as started without starting the daemon again 31+ # as started without starting the daemon again
32+ yesno "${IN_BACKGROUND}" && return 0 32+ yesno "${IN_BACKGROUND}" && return 0
33+ 33+
34+ [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"
35+
34 ebegin "Starting NetworkManager" 36 ebegin "Starting NetworkManager"
35 start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \ 37 start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \
36 --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid 38 --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid
37- eend $? 39- eend $?
38+ local _retval=$? 40+ local _retval=$?
39+ eend "${_retval}" 41+ eend "${_retval}"
40+ if [ "x${_retval}" = 'x0' ]; then 42+ if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then
43+ einfo "Marking NetworkManager as inactive. It will automatically be marked"
44+ einfo "as started after a network connection has been established."
41+ nm-online -t 5 || mark_service_inactive 45+ mark_service_inactive
42+ fi 46+ fi
43+ return "${_retval}" 47+ return "${_retval}"
44 } 48 }
45 49
46 stop() { 50 stop() {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20