diff options
author | Christian Heim <phreak@gentoo.org> | 2006-03-17 09:51:26 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2006-03-17 09:51:26 +0000 |
commit | 80cec78680195612923d8ef312481fea68470864 (patch) | |
tree | 624751ef2d174406b30983c9076d6545977cf33d | |
parent | Merging r1943 (diff) | |
download | baselayout-vserver-80cec78680195612923d8ef312481fea68470864.tar.gz baselayout-vserver-80cec78680195612923d8ef312481fea68470864.tar.bz2 baselayout-vserver-80cec78680195612923d8ef312481fea68470864.zip |
Merging r1948
svn path=/baselayout-vserver/branches/baselayout-1_12/; revision=290
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | ChangeLog.vserver | 13 | ||||
-rwxr-xr-x | net-scripts/init.d/net.lo | 2 | ||||
-rw-r--r-- | net-scripts/net.modules.d/iwconfig | 29 | ||||
-rw-r--r-- | sbin/rc-daemon.sh | 2 | ||||
-rwxr-xr-x | sbin/rc-services.sh | 2 | ||||
-rwxr-xr-x | sbin/runscript.sh | 10 |
7 files changed, 66 insertions, 7 deletions
@@ -1,6 +1,21 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 + 14 Mar 2006; Roy Marples <uberlord@gentoo.org>: + + Allow services that depend on net to be stopped/started in post + up/down functions when the net service is started by rc. + + 13 Mar 2006; Roy Marples <uberlord@gentoo.org>: + + Allow more than 1 inactive dependant service to start us when it is + started, #125819 thanks to Arnuad Fabre. + + 12 Mar 2006; Roy Marples <uberlord@gentoo.org>: + + iwconfig now strips duplicate mac addresses from scan results which means + we only try and connect to ad-hoc networks once. + 10 Mar 2006; Roy Marples <uberlord@gentoo.org>: iwconfig now reports mode in scan results diff --git a/ChangeLog.vserver b/ChangeLog.vserver index 305354d..6566e91 100644 --- a/ChangeLog.vserver +++ b/ChangeLog.vserver @@ -1,6 +1,19 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 + 17 Mar 2006; Christian Heim <phreak@gentoo.org>: + Merging latest changes to the baselayout-1_12 branch. This merge is based + upon revision 1948. + + ChangeLog | 15 +++++++++ + ChangeLog.vserver | 13 ++++++++ + net-scripts/init.d/net.lo | 2 + + net-scripts/net.modules.d/iwconfig | 29 ++++++++++++++++-- + sbin/rc-daemon.sh | 2 - + sbin/rc-services.sh | 2 - + sbin/runscript.sh | 10 ++++-- + 7 files changed, 66 insertions(+), 7 deletions(-) + 11 Mar 2006; Christian Heim <phreak@gentoo.org>: Merging latest changes to the baselayout-1_12 branch. This merge is based upon revision 1943. diff --git a/net-scripts/init.d/net.lo b/net-scripts/init.d/net.lo index 0ee6262..f73dfac 100755 --- a/net-scripts/init.d/net.lo +++ b/net-scripts/init.d/net.lo @@ -796,6 +796,7 @@ run_start() { # We need to mark the service as started incase a # postdown function wants to restart services that depend on us mark_service_started "net.${iface}" + end_service "net.${iface}" 0 einfo "Running postup function" eindent ( postup "${iface}" ) @@ -840,6 +841,7 @@ run_stop() { # We need to mark the service as stopped incase a # postdown function wants to restart services that depend on us [[ ${IN_BACKGROUND} != "true" ]] && mark_service_stopped "net.${iface}" + end_service "net.${iface}" 0 einfo "Running postdown function" eindent ( postdown "${iface}" ) diff --git a/net-scripts/net.modules.d/iwconfig b/net-scripts/net.modules.d/iwconfig index 73fa5b0..0711043 100644 --- a/net-scripts/net.modules.d/iwconfig +++ b/net-scripts/net.modules.d/iwconfig @@ -170,7 +170,7 @@ iwconfig_user_config() { if [[ -n ${!conf} ]]; then aconf=( "${!conf}" ) for conf in "${aconf[@]}" ; do - if ! eval iwconfig "${iface}" "${conf}" ; then + if ! iwconfig "${iface}" ${conf} ; then ewarn "${iface} does not support the following configuration commands" ewarn " ${conf}" fi @@ -181,7 +181,7 @@ iwconfig_user_config() { if [[ -n ${!conf} ]]; then aconf=( "${!conf}" ) for conf in "${aconf[@]}" ; do - if ! eval iwpriv "${iface}" "${conf}" ; then + if ! iwpriv "${iface}" ${conf} ; then ewarn "${iface} does not support the following private ioctls" ewarn " ${conf}" fi @@ -512,6 +512,31 @@ iwconfig_scan() { x="$( echo "${!x:-managed}" | tr '[:upper:]' '[:lower:]' )" [[ ${mode} != "${x}" ]] && iwconfig "${iface}" mode "${x}" + # Strip any duplicates + local i j x="${#mac[@]}" y + for (( i=0; i<x-1; i++ )) ; do + [[ -z ${mac[i]} ]] && continue + for (( j=i+1; j<x; j++)) ; do + if [[ ${mac[i]} == "${mac[j]}" ]] ; then + if [[ ${qual[i]} -gt ${qual[j]} ]] ; then + y="${j}" + else + y="${j}" + fi + unset mac[y] + unset qual[y] + unset essid[y] + unset mode[y] + unset enc[y] + fi + done + done + mac=( "${mac[@]}" ) + qual=( "${qual[@]}" ) + essid=( "${essid[@]}" ) + mode=( "${mode[@]}" ) + enc=( "${enc[@]}" ) + for (( i=0; i<${#mac[@]}; i++ )); do # Don't like ad-hoc nodes by default [[ ${mode[i]} == "ad-hoc" ]] && (( qual[i]-=10000 )) diff --git a/sbin/rc-daemon.sh b/sbin/rc-daemon.sh index 9f9cd26..81ca457 100644 --- a/sbin/rc-daemon.sh +++ b/sbin/rc-daemon.sh @@ -16,7 +16,7 @@ RC_GOT_DAEMON="yes" [[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source /sbin/functions.sh -[[ ${RC_GOT_SVCNAMES} != "yes" ]] && source "${svclib}/sh/rc-services.sh" +[[ ${RC_GOT_SERVICES} != "yes" ]] && source "${svclib}/sh/rc-services.sh" RC_RETRY_KILL="no" RC_RETRY_TIMEOUT=1 diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh index fd2bf48..adad35a 100755 --- a/sbin/rc-services.sh +++ b/sbin/rc-services.sh @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # RC Dependency and misc service functions -RC_GOT_SVCNAMES="yes" +RC_GOT_SERVICES="yes" [[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source /sbin/functions.sh diff --git a/sbin/runscript.sh b/sbin/runscript.sh index d43fae8..64a3ec5 100755 --- a/sbin/runscript.sh +++ b/sbin/runscript.sh @@ -42,7 +42,7 @@ svcpause="no" svcrestart="no" # Functions to handle dependencies and services -[[ ${RC_GOT_SVCNAMES} != "yes" ]] && source "${svclib}/sh/rc-services.sh" +[[ ${RC_GOT_SERVICES} != "yes" ]] && source "${svclib}/sh/rc-services.sh" # Functions to control daemons [[ ${RC_GOT_DAEMON} != "yes" ]] && source "${svclib}/sh/rc-daemon.sh" @@ -354,11 +354,12 @@ svc_start() { if service_inactive "${x}" || service_wasinactive "${x}" || \ [[ -n $(ls "${svcdir}"/scheduled/*/"${x}" 2>/dev/null) ]] ; then svc_schedule_start "${x}" "${SVCNAME}" - startinactive="${x}" + [[ -n ${startinactive} ]] && startinactive="${startinactive}, " + startinactive="${startinactive}${x}" else startfail="${x}" + break fi - break fi fi done @@ -368,6 +369,9 @@ svc_start() { eerror " ${SVCNAME} was not started." retval=1 elif [[ -n ${startinactive} ]] ; then + # Change the last , to or for correct grammar. + x="${startinactive##*, }" + startinactive="${startinactive/%, ${x}/ or ${x}}" ewarn "WARNING: ${SVCNAME} is scheduled to start when ${startinactive} has started." retval=1 elif broken "${SVCNAME}" ; then |