diff options
author | Christian Heim <phreak@gentoo.org> | 2005-12-22 09:40:51 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2005-12-22 09:40:51 +0000 |
commit | c1395f64105640981658134855c899bc316c72c7 (patch) | |
tree | bac28abd4d8d23f57ada16511c4aa2115b8ecd57 /net-scripts/net.modules.d | |
parent | fix devpts for openvz (diff) | |
download | baselayout-vserver-c1395f64105640981658134855c899bc316c72c7.tar.gz baselayout-vserver-c1395f64105640981658134855c899bc316c72c7.tar.bz2 baselayout-vserver-c1395f64105640981658134855c899bc316c72c7.zip |
Importing latest baselayout/trunk changes. This is a merge with revision 1768.
svn path=/baselayout-vserver/trunk/; revision=177
Diffstat (limited to 'net-scripts/net.modules.d')
-rw-r--r-- | net-scripts/net.modules.d/dhclient | 7 | ||||
-rw-r--r-- | net-scripts/net.modules.d/dhcpcd | 3 | ||||
-rwxr-xr-x | net-scripts/net.modules.d/helpers.d/dhcp | 13 | ||||
-rw-r--r-- | net-scripts/net.modules.d/helpers.d/dhcp-state | 2 | ||||
-rw-r--r-- | net-scripts/net.modules.d/iwconfig | 50 | ||||
-rw-r--r-- | net-scripts/net.modules.d/udhcpc | 3 |
6 files changed, 19 insertions, 59 deletions
diff --git a/net-scripts/net.modules.d/dhclient b/net-scripts/net.modules.d/dhclient index 4754628..91a751a 100644 --- a/net-scripts/net.modules.d/dhclient +++ b/net-scripts/net.modules.d/dhclient @@ -135,18 +135,13 @@ dhclient_start() { # Bring up DHCP for this interface (or alias) ebegin "Running dhclient" - - # Stop dhclient if it's already running - dhclient_stop "${iface}" - local x=$( eval dhclient "${opts}" -1 -pf "${pidfile}" \ -sf "${MODULES_DIR}/helpers.d/dhclient-wrapper" -q "${iface}" 2>&1 ) # We just check the last 5 letters [[ ${x:${#x} - 5:5} == "bound" ]] if [[ $? != "0" ]]; then echo "${x}" - # We need to kill the process if we fail - [[ -e ${pidfile} ]] && kill -s TERM $( < "${pidfile}" ) 2>/dev/null + dhclient_stop "${iface}" &>/dev/null eend 1 return 1 fi diff --git a/net-scripts/net.modules.d/dhcpcd b/net-scripts/net.modules.d/dhcpcd index 12ed4c8..b7b942f 100644 --- a/net-scripts/net.modules.d/dhcpcd +++ b/net-scripts/net.modules.d/dhcpcd @@ -123,9 +123,6 @@ dhcpcd_start() { # Bring up DHCP for this interface (or alias) ebegin "Running dhcpcd" - # Halt any existing dhcpcd process - dhcpcd_stop "${iface}" - [[ ! -d "${statedir}/${iface}" ]] && mkdir -m 0755 -p "${statedir}/${iface}" eval dhcpcd "${opts}" "${iface}" eend $? || return 1 diff --git a/net-scripts/net.modules.d/helpers.d/dhcp b/net-scripts/net.modules.d/helpers.d/dhcp index 52998ca..bb96565 100755 --- a/net-scripts/net.modules.d/helpers.d/dhcp +++ b/net-scripts/net.modules.d/helpers.d/dhcp @@ -17,12 +17,10 @@ case "${action}" in bound|renew) # We handle these actions below ;; - deconfig) + deconfig|leasefail) # Just remove IPv4 / inet addresses interface_del_addresses "${interface}" true - if service_starting "${service}" || service_started "${service}" ; then - mark_service_inactive "net.${interface}" - fi + service_started "${service}" && mark_service_inactive "net.${interface}" remove_state "${interface}" if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then best_interface=$( select_best_interface ) @@ -35,13 +33,6 @@ case "${action}" in echo "${action}" exit 0 ;; - leasefail) - if service_starting "${service}" || service_started "${service}" ; then - mark_service_inactive "net.${interface}" - fi - echo "${action}" - exit 0 - ;; *) echo "${action}" echo "We don't handle that action" >&2 diff --git a/net-scripts/net.modules.d/helpers.d/dhcp-state b/net-scripts/net.modules.d/helpers.d/dhcp-state index 244fbb0..6c91bea 100644 --- a/net-scripts/net.modules.d/helpers.d/dhcp-state +++ b/net-scripts/net.modules.d/helpers.d/dhcp-state @@ -15,7 +15,7 @@ if [[ ${action} != "up" ]]; then service_started "${service}" && mark_service_inactive "${service}" remove_state "${interface}" false else - ! service_stopping "${service}" && mark_service_started "${service}" + service_inactive "${service}" && mark_service_started "${service}" fi if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then diff --git a/net-scripts/net.modules.d/iwconfig b/net-scripts/net.modules.d/iwconfig index cd94cac..3f1eb22 100644 --- a/net-scripts/net.modules.d/iwconfig +++ b/net-scripts/net.modules.d/iwconfig @@ -191,19 +191,6 @@ iwconfig_setup_specific() { dessid="${ESSID//\\\\/\\\\}" ESSIDVAR=$( bash_variable "${ESSID}" ) key=$( iwconfig_get_wep_key ) - - if ! eval iwconfig "${iface}" key "${key}" ; then - if [[ ${key} != "off" ]]; then - ewarn "${iface} does not support setting keys" - ewarn "or the parameter \"mac_key_${ESSIDVAR}\" or \"key_${ESSIDVAR}\" is incorrect" - fi - fi - - if ! iwconfig "${iface}" essid "${ESSID}" ; then - eerror "${iface} does not support setting ESSID to \"${dessid}\"" - return 1 - fi - iwconfig "${iface}" nick "${ESSID}" 2>/dev/null # We only change the mode if it's not the same local cur_mode=$( iwconfig_get_mode "${iface}" ) @@ -217,21 +204,28 @@ iwconfig_setup_specific() { channel="channel_${ifvar}" # We default the channel to 3 channel="${!channel:-3}" - if ! iwconfig "${iface}" channel "${channel}" ; then ewarn "${iface} does not support setting the channel to \"${channel}\"" return 1 fi - iwconfig_user_config "${iface}" - iwconfig_report "${iface}" + # Now set the key + if ! eval iwconfig "${iface}" key "${key}" ; then + if [[ ${key} != "off" ]]; then + ewarn "${iface} does not support setting keys" + ewarn "or the parameter \"mac_key_${ESSIDVAR}\" or \"key_${ESSIDVAR}\" is incorrect" + fi + fi - if ${IN_BACKGROUND}; then - mark_service_inactive "net.${iface}" - export IN_BACKGROUND - /etc/init.d/net.${iface} start & - exit 0 + # Finally set the ESSID + if ! iwconfig "${iface}" essid "${ESSID}" ; then + eerror "${iface} does not support setting ESSID to \"${dessid}\"" + return 1 fi + iwconfig "${iface}" nick "${ESSID}" 2>/dev/null + + iwconfig_user_config "${iface}" + iwconfig_report "${iface}" return 0 } @@ -398,14 +392,6 @@ iwconfig_associate() { eoutdent fi - if ${IN_BACKGROUND}; then - mark_service_started "net.${iface}" - mark_service_inactive "net.${iface}" - export IN_BACKGROUND - /etc/init.d/net.${iface} start & - exit 0 - fi - return 0 } @@ -841,12 +827,6 @@ iwconfig_configure() { return $? fi - if ${IN_BACKGROUND}; then - export IN_BACKGROUND - /etc/init.d/net.${iface} stop & - exit 0 - fi - eerror "${e}" return 1 } diff --git a/net-scripts/net.modules.d/udhcpc b/net-scripts/net.modules.d/udhcpc index b9f566c..b7dde5a 100644 --- a/net-scripts/net.modules.d/udhcpc +++ b/net-scripts/net.modules.d/udhcpc @@ -91,9 +91,6 @@ udhcpc_start() { # Bring up DHCP for this interface (or alias) ebegin "Running udhcpc" - # Stop any instance of udhcpc on this interface - udhcpc_stop "${interface}" - # Try and load the cache if it exists if [[ -f ${cachefile} ]]; then if [[ " ${opts}" != *" --request="* && " ${opts} " != *" -r "* ]]; then |