diff options
author | David P <megver83@parabola.nu> | 2021-07-06 19:26:48 -0400 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2021-07-06 19:26:48 -0400 |
commit | 19d5e1a2cd2bb2844b93b73dd09cf2fa6c4df636 (patch) | |
tree | 08c923a9802cb0f5d42e43237da5ca261f5ae107 /nonsystemd/networkmanager/NetworkManager.initd | |
parent | 441462c7d6194d4ca23346530962258b8acf2ca9 (diff) | |
download | abslibre-19d5e1a2cd2bb2844b93b73dd09cf2fa6c4df636.tar.gz abslibre-19d5e1a2cd2bb2844b93b73dd09cf2fa6c4df636.tar.bz2 abslibre-19d5e1a2cd2bb2844b93b73dd09cf2fa6c4df636.zip |
updpkg: nonsystemd/networkmanager 1.32.2-1.nonsystemd1
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'nonsystemd/networkmanager/NetworkManager.initd')
-rw-r--r-- | nonsystemd/networkmanager/NetworkManager.initd | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/nonsystemd/networkmanager/NetworkManager.initd b/nonsystemd/networkmanager/NetworkManager.initd index 3209644c5..4829618da 100644 --- a/nonsystemd/networkmanager/NetworkManager.initd +++ b/nonsystemd/networkmanager/NetworkManager.initd @@ -1,58 +1,64 @@ -#!/sbin/openrc-run +#!/usr/bin/openrc-run # Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org> -# Copyright 2013-2017 Gentoo Foundation +# Copyright 2013-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 description="NetworkManager daemon. The service is marked as started only \ when a network connection is established." +# supervisor="supervise-daemon" +# command="/usr/bin/NetworkManager" +# command_args="-n" +# pidfile="/run/NetworkManager/NetworkManager.pid" depend() { - need dbus - use consolekit - provide net + need dbus + use logind + provide net +} + +start_pre() { + checkpath -q -d -m 0755 /run/NetworkManager } 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}" + # 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}" } 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 -} + # 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 -# vim: set ft=gentoo-init-d ts=4 : + 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 +} |