diff options
author | Christian Heim <phreak@gentoo.org> | 2006-01-15 10:42:17 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2006-01-15 10:42:17 +0000 |
commit | 5ad71a399280f9210b1076099b7ee64ed36ff0b8 (patch) | |
tree | 9aa9725a755b67b0c86a718ba8cecc42f6ac6f20 /net-scripts | |
parent | Merging r1802 (diff) | |
download | baselayout-vserver-5ad71a399280f9210b1076099b7ee64ed36ff0b8.tar.gz baselayout-vserver-5ad71a399280f9210b1076099b7ee64ed36ff0b8.tar.bz2 baselayout-vserver-5ad71a399280f9210b1076099b7ee64ed36ff0b8.zip |
Merging r1822 from trunk
svn path=/baselayout-vserver/trunk/; revision=208
Diffstat (limited to 'net-scripts')
-rwxr-xr-x | net-scripts/init.d/net.lo | 9 | ||||
-rw-r--r-- | net-scripts/net.modules.d/bonding | 4 | ||||
-rw-r--r-- | net-scripts/net.modules.d/bridge | 4 | ||||
-rw-r--r-- | net-scripts/net.modules.d/helpers.d/functions | 6 | ||||
-rw-r--r-- | net-scripts/net.modules.d/ifconfig | 7 | ||||
-rw-r--r-- | net-scripts/net.modules.d/iproute2 | 5 |
6 files changed, 24 insertions, 11 deletions
diff --git a/net-scripts/init.d/net.lo b/net-scripts/init.d/net.lo index 2a8ac84..04f030d 100755 --- a/net-scripts/init.d/net.lo +++ b/net-scripts/init.d/net.lo @@ -787,6 +787,9 @@ run_start() { # Call user-defined postup function if it exists if is_function postup ; then + # 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}" einfo "Running postup function" eindent ( postup "${iface}" ) @@ -823,8 +826,14 @@ run_stop() { iface_stop "${iface}" || return 1 # always succeeds, btw + # Mark us as inactive if called from the background + [[ ${IN_BACKGROUND} == "true" ]] && mark_service_inactive "net.${iface}" + # Call user-defined postdown function if it exists if is_function postdown ; then + # 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}" einfo "Running postdown function" eindent ( postdown "${iface}" ) diff --git a/net-scripts/net.modules.d/bonding b/net-scripts/net.modules.d/bonding index 3e629c8..62431aa 100644 --- a/net-scripts/net.modules.d/bonding +++ b/net-scripts/net.modules.d/bonding @@ -58,9 +58,7 @@ bonding_pre_start() { # Check that our slaves exist for s in "${slaves[@]}" ; do - interface_exists "${s}" && continue - ewarn "interface ${s} does not exist" - return 1 + interface_exists "${s}" true || return 1 done # Must force the slaves to a particular state before adding them diff --git a/net-scripts/net.modules.d/bridge b/net-scripts/net.modules.d/bridge index 6c77067..23a0be1 100644 --- a/net-scripts/net.modules.d/bridge +++ b/net-scripts/net.modules.d/bridge @@ -143,9 +143,7 @@ bridge_pre_start() { eindent for i in ${ports}; do - interface_exists "${i}" && continue - eerror "interface ${i} does not exist" - return 1 + interface_exists "${i}" true || return 1 done for i in ${ports}; do diff --git a/net-scripts/net.modules.d/helpers.d/functions b/net-scripts/net.modules.d/helpers.d/functions index eebb55d..dd325a3 100644 --- a/net-scripts/net.modules.d/helpers.d/functions +++ b/net-scripts/net.modules.d/helpers.d/functions @@ -38,7 +38,7 @@ save_state() { local d="${statedir}/${iface}" [[ ! -d ${d} ]] && mkdir -m 0755 -p "${d}" - cp -a /etc/resolv.conf /etc/ntp.conf /etc/yp.conf "${d}" 2>/dev/null + cp -p /etc/resolv.conf /etc/ntp.conf /etc/yp.conf "${d}" 2>/dev/null } # void remove_state(char *interface) @@ -70,7 +70,7 @@ apply_state() { local files=$( ls "${d}" ) if [[ -n ${files} ]] ; then if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then - cp -aR "${d}"/* "${netdir}" + cp -pPR "${d}"/* "${netdir}" local file for file in ${files} ; do # Skip .sv files @@ -82,7 +82,7 @@ apply_state() { fi done else - cp -ar "${d}"/* /etc + cp -pPR "${d}"/* /etc fi fi fi diff --git a/net-scripts/net.modules.d/ifconfig b/net-scripts/net.modules.d/ifconfig index b769215..05ef95a 100644 --- a/net-scripts/net.modules.d/ifconfig +++ b/net-scripts/net.modules.d/ifconfig @@ -42,7 +42,12 @@ ifconfig_check_installed() { ifconfig_exists() { local e=$( ifconfig -a | grep -o "^$1" ) report="${2:-false}" [[ -n ${e} ]] && return 0 - ${report} && eerror "$1 does not exist" + + if ${report} ; then + eerror "network interface $1 does not exist" + eerror "Please verify hardware or kernel module (driver)" + fi + return 1 } diff --git a/net-scripts/net.modules.d/iproute2 b/net-scripts/net.modules.d/iproute2 index cff83e2..8b6a9a7 100644 --- a/net-scripts/net.modules.d/iproute2 +++ b/net-scripts/net.modules.d/iproute2 @@ -46,7 +46,10 @@ iproute2_exists() { local e=$( ip addr show label "$1" ) report="${2:-false}" [[ -n ${e} ]] && return 0 - ${report} && eerror "$1 does not exist" + if ${report} ; then + eerror "network interface $1 does not exist" + eerror "Please verify hardware or kernel module (driver)" + fi return 1 } |