summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.vserver10
-rwxr-xr-xbin/rc-status20
-rw-r--r--net-scripts/conf.d/net.example76
-rwxr-xr-xsbin/rc-services.sh213
5 files changed, 201 insertions, 125 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c53d01..05f3012 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2
+ 07 Nov 2005; Roy Marples <uberlord@gentoo.org>:
+
+ documented pppd module settings, #53954
+
+ rc-status now warns about broken symbolic links in /etc/runlevels and
+ trace_dependencies got a bit of a revamp, attempts to fix #104394
+
04 Nov 2005; Roy Marples <uberlord@gentoo.org>:
udhcpc now checks the dhcp lease file for a valid IP address.
diff --git a/ChangeLog.vserver b/ChangeLog.vserver
index 546b8c3..4a78a97 100644
--- a/ChangeLog.vserver
+++ b/ChangeLog.vserver
@@ -1,6 +1,16 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2
+ 07 Nov 2005; Christian Heim <phreak@gentoo.org>:
+ Merging uberlord's latest changes of baselayout (r1599).
+
+ ChangeLog | 7 +
+ ChangeLog.vserver | 10 +
+ bin/rc-status | 20 +++
+ net-scripts/conf.d/net.example | 76 ++++++++++++++
+ sbin/rc-services.sh | 211 +++++++++++++++++------------------------
+ 4 files changed, 190 insertions(+), 124 deletions(-)
+
05 Nov 2005; Christian Heim <phreak@gentoo.org>:
Merging changes between baselayout r1583 and r1596.
diff --git a/bin/rc-status b/bin/rc-status
index 3450ba0..81b09eb 100755
--- a/bin/rc-status
+++ b/bin/rc-status
@@ -195,19 +195,33 @@ else
runlevelidxs="unused"
fi
+if [[ -f "/etc/runlevels/${BOOTLEVEL}/.critical" ]]; then
+ boot_crit=
+ for x in $(< /etc/runlevels/${BOOTLEVEL}/.critical); do
+ boot_crit="${boot_crit} ${x##*/}"
+ done
+else
+ boot_crit="checkroot hostname modules checkfs localmount clock"
+fi
+
for level in ${runlevelidxs} ; do
echo "Runlevel: ${HILITE}${level}${NORMAL}"
for service in ${runlevels[${arridx}]} ; do
- if [[ -n ${inactive} && $(in_list "${inactive}" "${service}") -eq 1 ]] ; then
+ if [[ ! -e ${runleveldir}/${level}/${service} \
+ && ${level} != "UNASSIGNED" \
+ && ${level} != "${BOOTLEVEL}" \
+ && " ${boot_crit} " != *" ${service} " ]]; then
+ print_msg "${service}" "${BAD}" 'broken '
+ elif [[ -n ${inactive} && $(in_list "${inactive}" "${service}") -eq 1 ]] ; then
print_msg "${service}" "${WARN}" 'inactive'
elif [[ $(in_list "${started}" "${service}") -eq 1 ]] ; then
- print_msg "${service}" "${GOOD}" 'started'
+ print_msg "${service}" "${GOOD}" 'started '
elif [[ -n ${starting} && $(in_list "${starting}" "${service}") -eq 1 ]] ; then
print_msg "${service}" "${GOOD}" 'starting'
elif [[ -n ${stopping} && $(in_list "${stopping}" "${service}") -eq 1 ]] ; then
print_msg "${service}" "${BAD}" 'stopping'
else
- print_msg "${service}" "${BAD}" 'stopped'
+ print_msg "${service}" "${BAD}" 'stopped '
fi
done
let "arridx += 1"
diff --git a/net-scripts/conf.d/net.example b/net-scripts/conf.d/net.example
index 42bc2e3..8a5078c 100644
--- a/net-scripts/conf.d/net.example
+++ b/net-scripts/conf.d/net.example
@@ -337,9 +337,83 @@
# need net.eth0 net.eth1
#}
+
+#-----------------------------------------------------------------------------
+# PPP
+# For PPP support, emerge net-dialup/ppp
+# PPP is used for most dialup connections, including ADSL.
+# The older ADSL module is documented below, but you are encouraged to try
+# this module first.
+#
+# You need to create the PPP net script yourself. Make it like so
+#cd /etc/init.d
+#ln -s net.lo net.ppp0
+#
+# Each PPP interface requires an interface to use as a "Link"
+#link_ppp0="eth0" # PPPoE requires an ethernet interface
+#link_ppp0="/dev/ttyS0" # Most PPP links will use a serial port
+#
+# PPP requires at least a username. You can optionally set a password here too
+# If you don't, then it will use the password specified in /etc/ppp/*-secrets
+# against the specified username
+#username_ppp0="user"
+#password_ppp0="password"
+#
+# The PPP daemon has many options you can specify - although there are many
+# and may seem daunting, it is recommended that you read the ppp man page
+# before enabling any of them
+#pppd_ppp0=(
+# "debug" # Enables syslog debugging
+# "noauth" # Do not require the peer to authenticate itself
+# "defaultroute" # Make this PPP interface the default route
+# "userpeerdns" # Use the DNS settings provided by PPP
+#
+# On demand options
+# "demand" # Enable dial on demand
+# "idle 30" # The link will go down after 30 seconds of inactivity
+# "10.112.112.112:10.112.112.113" # Phony IP addresses
+# "ipcp-accept-remote" # Accept the peers idea of remote address
+# "ipcp-accept-local" # Accept the peers idea of local address
+# "holdoff 3" # Wait 3 seconds after link dies before re-starting
+# "lcp-echo-interval 15" # Send a LCP echo every 15 seconds
+# "lcp-echo-failure 3" # Make peer dead after 3 seconds of in-activity
+#
+# Compression options - use these to completely disable compression
+# "noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp"
+#
+# Dial-up settings
+# "lock" # Lock serial port
+# "115200" # Set the serial port baud rate
+# "modem crtscts" # Enable hardware flow control
+# "192.168.0.1:192.168.0.2" # Local and remote IP addresses
+#)
+#
+# Dial-up PPP users need to specify a telephone number
+#phone_number_ppp0=( "12345689" )
+# They will also need a chat script - here's a good one
+#chat_ppp0=(
+# 'ABORT' 'BUSY'
+# 'ABORT' 'ERROR'
+# 'ABORT' 'NO ANSWER'
+# 'ABORT' 'NO CARRIER'
+# 'ABORT' 'NO DIALTONE'
+# 'ABORT' 'Invalid Login'
+# 'ABORT' 'Login incorrect'
+# 'TIMEOUT' '5'
+# '' 'ATZ'
+# 'OK' 'AT' # Put your modem initialization string here
+# 'OK' 'ATDT\T'
+# 'TIMEOUT' '60'
+# 'CONNECT' ''
+# 'TIMEOUT' '5'
+# '~--' ''
+#)
+
#-----------------------------------------------------------------------------
# ADSL
-# For ADSL support, emerge net-dialup/rp-pppoe
+# For ADSL support, emerge net-dialup/rp-pppoe
+# WARNING: This ADSL module is being deprecated in favour of the PPP module
+# above.
# You should make the following settings and also put your
# username/password information in /etc/ppp/pap-secrets
diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh
index d629dd4..b7e6043 100755
--- a/sbin/rc-services.sh
+++ b/sbin/rc-services.sh
@@ -58,7 +58,7 @@ get_service_index() {
return 1
fi
- local x myservice=$1 index=$2
+ local x myservice="$1" index="$2"
# Do we already have the index?
if [[ -n ${index} && ${index} -gt 0 \
@@ -86,7 +86,7 @@ get_service_index() {
get_dep_info() {
[[ -z $1 ]] && return 1
- local myservice=$1
+ local myservice="$1"
# We already have the right stuff ...
[[ ${myservice} == "${rc_name}" && -n ${rc_mtime} ]] && return 0
@@ -97,7 +97,7 @@ get_dep_info() {
# Verify that we have the correct index (rc_index) ...
# [[ ${rc_index} == "0" ]] && return 1
- rc_name=${RC_DEPEND_TREE[${rc_index}]}
+ rc_name="${RC_DEPEND_TREE[${rc_index}]}"
rc_ineed="${RC_DEPEND_TREE[$((${rc_index} + ${rc_type_ineed}))]}"
rc_needsme="${RC_DEPEND_TREE[$((${rc_index} + ${rc_type_needsme}))]}"
rc_iuse="${RC_DEPEND_TREE[$((${rc_index} + ${rc_type_iuse}))]}"
@@ -127,9 +127,9 @@ check_dependency() {
# Set the dependency variables to relate to 'service1'
if [[ $2 == "-t" ]] ; then
[[ -z $3 || -z $4 ]] && return 1
- myservice=$3
+ myservice="$3"
else
- myservice=$2
+ myservice="$2"
fi
if ! get_dep_info "${myservice}" >/dev/null ; then
@@ -213,10 +213,10 @@ is_fake_service() {
[[ -z $1 || -z $2 ]] && return 1
- [[ $2 != "${BOOTLEVEL}" && -e /etc/runlevels/${BOOTLEVEL}/.fake ]] && \
- fake_services=$( < /etc/runlevels/${BOOTLEVEL}/.fake )
+ [[ $2 != "${BOOTLEVEL}" && -e /etc/runlevels/"${BOOTLEVEL}"/.fake ]] && \
+ fake_services=$( < /etc/runlevels/"${BOOTLEVEL}"/.fake )
- [[ -e /etc/runlevels/$2/.fake ]] && \
+ [[ -e /etc/runlevels/"$2"/.fake ]] && \
fake_services="${fake_services} $( < /etc/runlevels/$2/.fake )"
for x in ${fake_services} ; do
@@ -233,7 +233,7 @@ is_fake_service() {
in_runlevel() {
[[ -z $1 || -z $2 ]] && return 1
- [[ -L /etc/runlevels/$2/$1 ]] && return 0
+ [[ -L "/etc/runlevels/$2/$1" ]] && return 0
return 1
}
@@ -244,7 +244,7 @@ in_runlevel() {
# starting services.
#
is_runlevel_start() {
- [[ -d ${svcdir}/softscripts.old && \
+ [[ -d "${svcdir}/softscripts.old" && \
${SOFTLEVEL} != "${OLDSOFTLEVEL}" ]] && return 0
return 1
@@ -256,7 +256,7 @@ is_runlevel_start() {
# stopping services.
#
is_runlevel_stop() {
- [[ -d ${svcdir}/softscripts.new && \
+ [[ -d "${svcdir}/softscripts.new" && \
${SOFTLEVEL} != "${OLDSOFTLEVEL}" ]] && return 0
return 1
@@ -274,7 +274,7 @@ service_message() {
shift
fi
- local r=${RC_QUIET_STDOUT}
+ local r="${RC_QUIET_STDOUT}"
RC_QUIET_STDOUT="no"
${cmd} "$@"
RC_QUIET_STDOUT=${r}
@@ -302,7 +302,7 @@ begin_service() {
# wakes up anybody who is waiting for the exclusive region
#
end_service() {
- local service=$1 exitstatus=$2
+ local service="$1" exitstatus="$2"
# if we are doing critical services, there is no fifo
[[ ${START_CRITICAL} == "yes" ]] && return
@@ -331,7 +331,7 @@ end_service() {
# Otherwise, wait until we get an exit code via the fifo and return
# that instead.
wait_service() {
- local service=$1
+ local service="$1"
local fifo="${svcdir}/exclusive/${service}"
[[ ${START_CRITICAL} == "yes" || ${STOP_CRITICAL} == "yes" ]] && return 0
@@ -350,7 +350,7 @@ wait_service() {
# Start 'service' if it is not already running.
#
start_service() {
- local service=$1
+ local service="$1"
[[ -z ${service} ]] && return 1
if [[ ! -e "/etc/init.d/${service}" ]] ; then
@@ -392,10 +392,10 @@ start_service() {
# Stop 'service' if it is not already running.
#
stop_service() {
- local service=$1
+ local service="$1"
[[ -z ${service} ]] && return 1
- if [[ ! -e /etc/init.d/${service} ]] ; then
+ if [[ ! -e "/etc/init.d/${service}" ]] ; then
mark_service_stopped "${service}"
return 0
fi
@@ -404,7 +404,7 @@ stop_service() {
service_stopped "${service}" && return 0
local level="${SOFTLEVEL}"
- is_runlevel_stop && level=${OLDSOFTLEVEL}
+ is_runlevel_stop && level="${OLDSOFTLEVEL}"
if is_fake_service "${service}" "${level}" ; then
mark_service_stopped "${service}"
@@ -442,9 +442,9 @@ mark_service_starting() {
ln -snf "/etc/init.d/$1" "${svcdir}/starting/$1"
local retval=$?
- [[ -f ${svcdir}/started/$1 ]] && rm -f "${svcdir}/started/$1"
- [[ -f ${svcdir}/inactive/$1 ]] && rm -f "${svcdir}/inactive/$1"
- [[ -f ${svcdir}/stopping/$1 ]] && rm -f "${svcdir}/stopping/$1"
+ [[ -f "${svcdir}/started/$1" ]] && rm -f "${svcdir}/started/$1"
+ [[ -f "${svcdir}/inactive/$1" ]] && rm -f "${svcdir}/inactive/$1"
+ [[ -f "${svcdir}/stopping/$1" ]] && rm -f "${svcdir}/stopping/$1"
return "${retval}"
}
@@ -459,9 +459,9 @@ mark_service_started() {
ln -snf "/etc/init.d/$1" "${svcdir}/started/$1"
local retval=$?
- [[ -f ${svcdir}/starting/$1 ]] && rm -f "${svcdir}/starting/$1"
- [[ -f ${svcdir}/inactive/$1 ]] && rm -f "${svcdir}/inactive/$1"
- [[ -f ${svcdir}/stopping/$1 ]] && rm -f "${svcdir}/stopping/$1"
+ [[ -f "${svcdir}/starting/$1" ]] && rm -f "${svcdir}/starting/$1"
+ [[ -f "${svcdir}/inactive/$1" ]] && rm -f "${svcdir}/inactive/$1"
+ [[ -f "${svcdir}/stopping/$1" ]] && rm -f "${svcdir}/stopping/$1"
return "${retval}"
}
@@ -475,9 +475,9 @@ mark_service_inactive() {
ln -snf "/etc/init.d/$1" "${svcdir}/inactive/$1"
local retval=$?
- [[ -f ${svcdir}/started/$1 ]] && rm -f "${svcdir}/started/$1"
- [[ -f ${svcdir}/starting/$1 ]] && rm -f "${svcdir}/starting/$1"
- [[ -f ${svcdir}/stopping/$1 ]] && rm -f "${svcdir}/stopping/$1"
+ [[ -f "${svcdir}/started/$1" ]] && rm -f "${svcdir}/started/$1"
+ [[ -f "${svcdir}/starting/$1" ]] && rm -f "${svcdir}/starting/$1"
+ [[ -f "${svcdir}/stopping/$1" ]] && rm -f "${svcdir}/stopping/$1"
return "${retval}"
}
@@ -492,9 +492,9 @@ mark_service_stopping() {
ln -snf "/etc/init.d/$1" "${svcdir}/stopping/$1"
local retval=$?
- [ -f ${svcdir}/starting/$1 ] && rm -f "${svcdir}/starting/$1"
- [ -f ${svcdir}/started/$1 ] && rm -f "${svcdir}/started/$1"
- [ -f ${svcdir}/inactive/$1 ] && rm -f "${svcdir}/inactive/$1"
+ [[ -f "${svcdir}/starting/$1" ]] && rm -f "${svcdir}/starting/$1"
+ [[ -f "${svcdir}/started/$1" ]] && rm -f "${svcdir}/started/$1"
+ [[ -f "${svcdir}/inactive/$1" ]] && rm -f "${svcdir}/inactive/$1"
return "${retval}"
}
@@ -506,11 +506,11 @@ mark_service_stopping() {
mark_service_stopped() {
[[ -z $1 ]] && return 1
- [[ -f ${svcdir}/daemons/$1 ]] && rm -f "${svcdir}/daemons/$1"
- [[ -f ${svcdir}/starting/$1 ]] && rm -f "${svcdir}/starting/$1"
- [[ -f ${svcdir}/started/$1 ]] && rm -f "${svcdir}/started/$1"
- [[ -f ${svcdir}/inactive/$1 ]] && rm -f "${svcdir}/inactive/$1"
- [[ -f ${svcdir}/stopping/$1 ]] && rm -f "${svcdir}/stopping/$1"
+ [[ -f "${svcdir}/daemons/$1" ]] && rm -f "${svcdir}/daemons/$1"
+ [[ -f "${svcdir}/starting/$1" ]] && rm -f "${svcdir}/starting/$1"
+ [[ -f "${svcdir}/started/$1" ]] && rm -f "${svcdir}/started/$1"
+ [[ -f "${svcdir}/inactive/$1" ]] && rm -f "${svcdir}/inactive/$1"
+ [[ -f "${svcdir}/stopping/$1" ]] && rm -f "${svcdir}/stopping/$1"
return $?
}
@@ -584,7 +584,7 @@ service_stopped() {
# this is only valid on runlevel change ...
#
mark_service_failed() {
- [[ -z $1 || ! -d ${svcdir}/failed ]] && return 1
+ [[ -z $1 || ! -d "${svcdir}/failed" ]] && return 1
ln -snf "/etc/init.d/$1" "${svcdir}/failed/$1"
}
@@ -594,7 +594,7 @@ mark_service_failed() {
# Return true if 'service' have failed during this runlevel.
#
service_failed() {
- [[ -n $1 && -L ${svcdir}/failed/$1 ]]
+ [[ -n $1 && -L "${svcdir}/failed/$1" ]]
}
# bool service_started_daemon(char *interface, char *daemon, int index)
@@ -669,15 +669,15 @@ dependon() {
valid_i() {
local x
# Just set to dummy for now (don't know if $svcdir/softlevel exists yet).
- local mylevel=${BOOTLEVEL}
+ local mylevel="${BOOTLEVEL}"
[[ $1 != "after" && $1 != "use" ]] && return 1
# Cannot be SOFTLEVEL, as we need to know current runlevel
- [[ -f ${svcdir}/softlevel ]] && mylevel=$( < "${svcdir}/softlevel" )
+ [[ -f "${svcdir}/softlevel" ]] && mylevel=$( < "${svcdir}/softlevel" )
for x in $( i$1 "$2" ) ; do
- [[ -e /etc/runlevels/${BOOTLEVEL}/${x} || \
+ [[ -e "/etc/runlevels/${BOOTLEVEL}/${x}" || \
-e "/etc/runlevels/${mylevel}/${x}" || \
${x} == "net" ]] \
&& echo "${x}"
@@ -709,11 +709,11 @@ valid_iafter() {
# Get and sort the dependencies of given service[s].
#
trace_dependencies() {
- local -a services=( "$@" ) deps
- local i j
+ local -a services=( "$@" )
+ local i j net_services
- if [[ $1 == -* ]] ; then
- deptype=${1/-}
+ if [[ $1 == -* ]]; then
+ deptype="${1/-}"
if net_service "${myservice}" ; then
services=( "net" "${myservice}" )
else
@@ -721,43 +721,48 @@ trace_dependencies() {
fi
fi
- # If its a net service, just replace it with 'net'
- if [[ -z ${deptype} ]] ; then
- for (( i=0; i<${#services[@]} ; i++ )) ; do
- net_service "${services[i]}" && services[i]="net"
- done
- fi
+ net_services=$( cd "${svcdir}"/started; ls net.* 2>/dev/null )
+ # If no net services are running or we only have net.lo up, then
+ # assume we are in boot runlevel or starting a new runlevel
+ if [[ -z ${net_services} || ${net_services} == "net.lo" ]]; then
+ get_net_services() {
+ local runlevel="$1"
- sort_unique() {
- set -- " ${@/%/\n}"
- echo -e "$@" | sort -u
- }
+ if [[ -d "/etc/runlevels/${runlevel}" ]] ; then
+ cd "/etc/runlevels/${runlevel}"
+ ls net.* 2>/dev/null
+ fi
+ }
- local last=""
- while [[ ${services[@]} != "${last}" ]] ; do
- last="${services[*]}"
- for (( i=0; i<${#services[@]}; i++ )) ; do
- if [[ -n ${deptype} ]] ; then
- deps=( "${deps[@]}" $( "${deptype}" "${services[i]}" ) )
- else
- ndeps=(
- $( ineed "${services[i]}" )
- $( valid_iuse "${services[i]}" )
- )
-
- if is_runlevel_start || is_runlevel_stop ; then
- ndeps=( "${ndeps[@]}" $( valid_iafter "${services[i]}" ) )
- fi
-
- #If its a net service, just replace it with 'net'
- for (( j=0; j<${#ndeps[*]}; j++ )) ; do
- net_service "${ndeps[j]}" && ndeps[j]="net"
- done
-
- deps=( "${deps[@]}" "${ndeps[@]}" )
+ local mylevel="${BOOTLEVEL}"
+ local x=$( get_net_services "${mylevel}" )
+
+ [[ -f "${svcdir}/softlevel" ]] && mylevel=$( < "${svcdir}/softlevel" )
+ [[ ${BOOTLEVEL} != "${mylevel}" ]] && \
+ local x="${x} $( get_net_services "${mylevel}" )"
+ [[ -n ${x} ]] && net_services="${x}"
+ fi
+
+ local -a visited
+ for (( i=0; i<${#services[@]}; i++)); do
+ [[ ${visited[@]} == *" ${services[i]} "* ]] && continue
+ if [[ -n ${deptype} ]] ; then
+ deps=( "${deps[@]}" $( "${deptype}" "${services[i]}" ) )
+ else
+ deps=(
+ $( ineed "${services[i]}" )
+ $( valid_iuse "${services[i]}" )
+ )
+
+ if is_runlevel_start || is_runlevel_stop ; then
+ deps=( "${deps[@]}" $( valid_iafter "${services[i]}" ) )
fi
- done
- services=( $(sort_unique ${services[@]} ${deps[@]}) )
+
+ local x=" ${deps[@]} "
+ deps=( ${x// net / ${net_services} } )
+ fi
+ services=( "${services[@]}" "${deps[@]}" )
+ visited=( "${visited[@]}" "${services[i]}" )
done
# Now, we sort our services
@@ -765,41 +770,39 @@ trace_dependencies() {
# revisit any dependencies. Finally we add ourselves to the sorted list.
# This should never get into an infinite loop, thanks to our dead array.
local -a dead=() deadname=() sorted=()
- for (( i=0; i<${#services[@]}; i++ )) ; do
- dead[i]="false"
+ for (( i=0; i<${#services[@]}; i++ )); do
+ dead[i]="false";
deadname[i]="${services[i]}"
done
after_visit() {
- local service=$1 i
+ local service="$1" i
- for (( i=0; i<${#deadname[@]}; i++)) ; do
+ for (( i=0; i<${#deadname[@]}; i++)); do
[[ ${service} == ${deadname[i]} ]] && break
done
${dead[i]} && return
dead[i]="true"
- local x deps="$( ineed ${service} ) $( valid_iuse ${service} )"
+ local x deps=" $( ineed ${service} ) $( valid_iuse ${service} ) "
if is_runlevel_start || is_runlevel_stop ; then
- deps="${deps} $( valid_iafter ${service} )"
+ deps="${deps} $( valid_iafter ${service} ) "
fi
if [[ -z ${deptype} ]] ; then
# If its a net service, just replace it with 'net'
- for (( j=0; j<${#deps[@]}; j++ )) ; do
- net_service "${deps[j]}" && deps[j]="net"
- done
+ deps="${deps// net / ${net_services} }"
fi
- for x in ${deps} ; do
+ for x in ${deps}; do
after_visit "${x}"
done
sorted=( "${sorted[@]}" "${service}" )
}
- for (( i=0; i<${#services[*]}; i++ )) ; do
+ for (( i=0; i<${#services[*]}; i++ )); do
after_visit "${services[i]}"
done
services=( "${sorted[@]}" )
@@ -814,37 +817,6 @@ trace_dependencies() {
x=" ${services[@]} "
sorted=( ${services// net / } )
fi
- else
- local netserv y
-
- # XXX: I dont think RC_NET_STRICT_CHECKING should be considered
- # here, but you never know ...
- netserv=$( cd "${svcdir}"/started; ls net.* 2>/dev/null )
-
- get_netservices() {
- local runlevel=$1
-
- if [[ -d /etc/runlevels/${runlevel} ]] ; then
- cd "/etc/runlevels/${runlevel}"
- ls net.* 2>/dev/null
- fi
- }
-
- # If no net services are running or we only have net.lo up, then
- # assume we are in boot runlevel or starting a new runlevel
- if [[ -z ${netserv} || ${netserv} == "net.lo" ]] ; then
- local mylevel=${BOOTLEVEL}
- local startnetserv=$( get_netservices "${mylevel}" )
-
- [[ -f ${svcdir}/softlevel ]] && mylevel=$( < "${svcdir}/softlevel" )
- [[ ${BOOTLEVEL} != "${mylevel}" ]] && \
- startnetserv="${startnetserv} $( get_netservices "${mylevel}" )"
- [[ -n ${startnetserv} ]] && netserv=${startnetserv}
- fi
-
- # Replace 'net' with the actual net services
- x=" ${services[@]} "
- services=( ${x// net / ${netserv} } )
fi
echo "${services[@]}"
@@ -875,5 +847,4 @@ query_before() {
return 1
}
-
# vim:ts=4