Permalink
Browse files

FL-477: Use init script from the last version of NetworkManager

  • Loading branch information...
jeanfrancisroy committed Apr 3, 2013
1 parent 88d55f6 commit 4e1fdc3cdd2a993764a448e00c0c835d9913cd73
@@ -1,4 +0,0 @@
-# If NetworkManager does not establish a connection within $INACTIVE_TIMEOUT
-# seconds after starting, the service will be marked as inactive, and it will
-# continue to wait for a connection in background mode.
-INACTIVE_TIMEOUT=1
@@ -1,56 +1,22 @@
#!/sbin/runscript
# Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org>
# Distributed under the terms of the GNU General Purpose License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/init.d.NetworkManager,v 1.1 2013/01/28 07:05:05 tetromino Exp $
-
-description="NetworkManager daemon. The service is marked as started only \
-when a network connection is established."
depend() {
need dbus
}
start() {
- # If we are re-called by a dispatcher event, we want to mark the service
- # as started without starting the daemon again
- yesno "${IN_BACKGROUND}" && return 0
-
- [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"
-
ebegin "Starting NetworkManager"
start-stop-daemon --start --quiet --pidfile /run/NetworkManager/NetworkManager.pid \
--exec /usr/sbin/NetworkManager -- --pid-file /run/NetworkManager/NetworkManager.pid
- local _retval=$?
- eend "${_retval}"
- if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; then
- einfo "Marking NetworkManager as inactive. It will automatically be marked"
- einfo "as started after a network connection has been established."
- mark_service_inactive
- fi
- return "${_retval}"
+ eend $?
}
stop() {
- # If we are re-called by a dispatcher event, we want to mark the service
- # as inactive without stopping the daemon
- if yesno "${IN_BACKGROUND}"; then
- mark_service_inactive "${SVCNAME}"
- return 0
- fi
-
ebegin "Stopping NetworkManager"
- local pidfile=/run/NetworkManager/NetworkManager.pid
- if [ ! -e "${pidfile}" ] && [ -e /var/run/NetworkManager.pid ]; then
- # Try stopping the pid file used by <0.9.7
- pidfile=/var/run/NetworkManager.pid
- start-stop-daemon --stop --quiet --pidfile "${pidfile}"
- ret=$?
- [ ${ret} = 0 ] && [ -e "${pidfile}" ] && rm "${pidfile}"
- eend ${ret}
- else
- start-stop-daemon --stop --quiet --pidfile "${pidfile}"
- eend $?
- fi
+ start-stop-daemon --stop --quiet --pidfile /run/NetworkManager/NetworkManager.pid
+ eend $?
}
# vim: set ft=gentoo-init-d ts=4 :
@@ -178,9 +178,6 @@ src_install() {
newexe "${FILESDIR}/10-openrc-status-r3" 10-openrc-status
sed -e "s:@EPREFIX@:${EPREFIX}:g" \
-i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die
-
- # Default conf.d file
- newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager
fi
# Add keyfile plugin support

0 comments on commit 4e1fdc3

Please sign in to comment.