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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Feb 21 23:19:19 2012 UTC (2 years, 5 months ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +11 -7 lines
Make timeout to go inactive at init.d script startup configurable, and reduce it to 1 second by default (bug #405141, thanks to Sylvain Alain).

(Portage version: 2.2.0_alpha87/cvs/Linux x86_64)

1 From 705b9978ed914aba87e5a5191a1d0acacaf70a81 Mon Sep 17 00:00:00 2001
2 From: Alexandre Rostovtsev <tetromino@gentoo.org>
3 Date: Wed, 1 Feb 2012 05:51:20 -0500
4 Subject: [PATCH] gentoo: provide net and use inactive status when not
5 connected
6
7 The status will be reset to started via a dispatcher script on up/down
8 events. See https://bugs.gentoo.org/show_bug.cgi?id=252137
9 ---
10 initscript/Gentoo/NetworkManager.in | 26 +++++++++++++++++++++++++-
11 1 files changed, 25 insertions(+), 1 deletions(-)
12
13 diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in
14 index 7db410b..1960795 100755
15 --- a/initscript/Gentoo/NetworkManager.in
16 +++ b/initscript/Gentoo/NetworkManager.in
17 @@ -3,18 +3,42 @@
18 # Distributed under the terms of the GNU General Purpose License v2
19 # $Header: $
20
21 +description="NetworkManager daemon. The service is marked as started only \
22 +when a network connection is established."
23 +
24 depend() {
25 need dbus
26 + provide net
27 }
28
29 start() {
30 + # If we are re-called by a dispatcher event, we want to mark the service
31 + # as started without starting the daemon again
32 + yesno "${IN_BACKGROUND}" && return 0
33 +
34 + [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"
35 +
36 ebegin "Starting NetworkManager"
37 start-stop-daemon --start --quiet --pidfile /var/run/NetworkManager.pid \
38 --exec /usr/sbin/NetworkManager -- --pid-file /var/run/NetworkManager.pid
39 - eend $?
40 + local _retval=$?
41 + eend "${_retval}"
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."
45 + mark_service_inactive
46 + fi
47 + return "${_retval}"
48 }
49
50 stop() {
51 + # If we are re-called by a dispatcher event, we want to mark the service
52 + # as inactive without stopping the daemon
53 + if yesno "${IN_BACKGROUND}"; then
54 + mark_service_inactive "${SVCNAME}"
55 + return 0
56 + fi
57 +
58 ebegin "Stopping NetworkManager"
59 start-stop-daemon --stop --quiet --pidfile /var/run/NetworkManager.pid
60 eend $?
61 --
62 1.7.8.4

  ViewVC Help
Powered by ViewVC 1.1.20