diff options
author | Christian Heim <phreak@gentoo.org> | 2006-01-17 20:45:43 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2006-01-17 20:45:43 +0000 |
commit | 529ad884fab1e9a406eedf57764a2b80db6b4c4c (patch) | |
tree | 400153b706b7cd8da6f1af7bcac6dfd6f3d8c1ed | |
parent | Merging r1822 from trunk (diff) | |
download | baselayout-vserver-529ad884fab1e9a406eedf57764a2b80db6b4c4c.tar.gz baselayout-vserver-529ad884fab1e9a406eedf57764a2b80db6b4c4c.tar.bz2 baselayout-vserver-529ad884fab1e9a406eedf57764a2b80db6b4c4c.zip |
Merging r1828
svn path=/baselayout-vserver/trunk/; revision=209
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ChangeLog.vserver | 18 | ||||
-rwxr-xr-x | net-scripts/init.d/net.lo | 9 | ||||
-rwxr-xr-x | sbin/depscan.sh | 2 | ||||
-rwxr-xr-x | sbin/rc-services.sh | 16 | ||||
-rwxr-xr-x | sbin/runscript.sh | 59 |
6 files changed, 73 insertions, 44 deletions
@@ -1,6 +1,17 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 + 16 Jan 2006; Roy Marples <uberlord@gentoo.org>: + + Renamed restart in $svcdir to scheduled as it makes much more sense. + + Interfaces names with a dot in them now work. + + 15 Jan 2005; Roy Marples <uberlord@gentoo.org>: + + Changed wording about network modules in /etc/modules.autoload.d/*, + #118419. + 14 Jan 2006; Roy Marples <uberlord@gentoo.org>: Changed runscript.sh to store it's services to restart like rc. @@ -26,8 +37,6 @@ Interactive start is now controllable by RC_INTERACTIVE="yes" and will probe to see if we can go interactive. - Interactive start should now work on Sparc, #104067. - 11 Jan 2006; Roy Marples <uberlord@gentoo.org>: runscript.sh now traps interrupt signals and rolls back its status to what diff --git a/ChangeLog.vserver b/ChangeLog.vserver index 0311046..e279dd7 100644 --- a/ChangeLog.vserver +++ b/ChangeLog.vserver @@ -1,7 +1,19 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2 - 15 Jan 2005; Christian Heim <phreak@gentoo.org>: + 17 Jan 2006; Christian Heim <phreak@gentoo.org>: + Importing latest baselayout/trunk changes. This merge is based upon + revision 1828. + + ChangeLog | 13 +++ + ChangeLog.vserver | 18 ++++- + net-scripts/init.d/net.lo | 9 +- + sbin/depscan.sh | 2 + sbin/rc-services.sh | 16 +++- + sbin/runscript.sh | 59 +++++++++--------- + 6 files changed, 73 insertions(+), 44 deletions(-) + + 15 Jan 2006; Christian Heim <phreak@gentoo.org>: Importing latest baselayout/trunk changes. This merge is based upon revision 1822. @@ -22,7 +34,7 @@ sbin/runscript.sh | 258 ++++++++++-------- 15 files changed, 269 insertions(+), 181 deletions(-) - 11 Jan 2005; Christian Heim <phreak@gentoo.org>: + 11 Jan 2006; Christian Heim <phreak@gentoo.org>: Importing latest baselayout/trunk changes. This merge is based upon revision 1802. @@ -36,7 +48,7 @@ sbin/runscript.sh | 133 ++++++++++++------ 8 files changed, 151 insertions(+), 53 deletions(-) - 10 Jan 2005; Christian Heim <phreak@gentoo.org>: + 10 Jan 2006; Christian Heim <phreak@gentoo.org>: Importing latest baselayout/trunk changes. This merge is based upon revision 1799. diff --git a/net-scripts/init.d/net.lo b/net-scripts/init.d/net.lo index 04f030d..b9c2352 100755 --- a/net-scripts/init.d/net.lo +++ b/net-scripts/init.d/net.lo @@ -166,11 +166,12 @@ modules_check_installed() { # bool modules_check_user(void) modules_check_user() { - local -a umods + local iface="$1" ifvar="$(bash_variable "${IFACE}")" local i j k l nmods="${#MODULES[@]}" + local -a umods # Has the interface got any specific modules? - umods="modules_${iface}[@]" + umods="modules_${ifvar}[@]" umods=( "${!umods}" ) # Global setting follows interface-specific setting @@ -190,7 +191,7 @@ modules_check_user() { [[ ${umods[i]} == "dhcp" ]] && continue # We remove any modules we explicitly don't want - if [[ ${umods[i]} == !* ]]; then + if [[ ${umods[i]} == "!"* ]]; then for (( j=0; j<nmods; j++ )); do [[ -z ${MODULES[j]} ]] && continue if [[ ${umods[i]:1} == "${MODULES[j]}" \ @@ -463,7 +464,7 @@ modules_load() { PROVIDES=( "${PROVIDES[@]}" ) else if ${starting}; then - modules_check_user || return 1 + modules_check_user "${iface}" || return 1 else # Always prefer iproute2 for taking down interfaces if is_function iproute2_provide ; then diff --git a/sbin/depscan.sh b/sbin/depscan.sh index 10590d0..20669d2 100755 --- a/sbin/depscan.sh +++ b/sbin/depscan.sh @@ -17,7 +17,7 @@ fi for x in softscripts snapshot options daemons \ started starting inactive stopping failed \ - exclusive exitcodes restart ; do + exclusive exitcodes scheduled ; do if [[ ! -d "${svcdir}/${x}" ]] ; then if ! mkdir -p -m 0755 "${svcdir}/${x}" 2>/dev/null ; then eerror "Could not create needed directory '${svcdir}/${x}'!" diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh index 40dd877..98bbcd9 100755 --- a/sbin/rc-services.sh +++ b/sbin/rc-services.sh @@ -263,10 +263,16 @@ service_message() { [[ ${RC_PARALLEL_STARTUP} != "yes" ]] && return local cmd="einfo" - if [[ $1 == "1" || $1 == "error" || $1 == "eerror" ]] ; then - cmd="eerror" - shift - fi + case "$1" in + 1|error|eerror) + cmd="eerror" + shift + ;; + ewarn) + cmd="ewarn" + shift + ;; + esac local r="${RC_QUIET_STDOUT}" RC_QUIET_STDOUT="no" @@ -606,7 +612,7 @@ service_started_daemon() { # Returns true if 'service' is a service controlling a network interface # net_service() { - [[ -n $1 && ${1%%.*} == "net" && ${1##*.} != "$1" ]] + [[ -n $1 && ${1%%.*} == "net" && ${1#*.} != "$1" ]] } # bool is_net_up() diff --git a/sbin/runscript.sh b/sbin/runscript.sh index d1960a7..19adc43 100755 --- a/sbin/runscript.sh +++ b/sbin/runscript.sh @@ -40,8 +40,8 @@ svc_trap [[ ${RC_GOT_DAEMON} != "yes" ]] && source "${svclib}/sh/rc-daemon.sh" # Set $IFACE to the name of the network interface if it is a 'net.*' script -if [[ ${myservice%%.*} == "net" && ${myservice##*.} != "${myservice}" ]] ; then - IFACE="${myservice##*.}" +if [[ ${myservice%%.*} == "net" && ${myservice#*.} != "${myservice}" ]] ; then + IFACE="${myservice#*.}" NETSERVICE="yes" else IFACE= @@ -115,29 +115,29 @@ status() { return 0 } -svc_schedule_restart() { - local service="$1" restart="$2" - [[ ! -d "${svcdir}/restart/${service}" ]] \ - && mkdir -p "${svcdir}/restart/${service}" - [[ ! -e "${svcdir}/restart/${service}/${restart}" ]] \ +svc_schedule_start() { + local service="$1" start="$2" + [[ ! -d "${svcdir}/scheduled/${service}" ]] \ + && mkdir -p "${svcdir}/scheduled/${service}" + [[ ! -e "${svcdir}/scheduled/${service}/${start}" ]] \ && ln -snf "/etc/init.d/${service}" \ - "${svcdir}/restart/${service}/${restart}" + "${svcdir}/scheduled/${service}/${start}" } -svc_start_restart() { - [[ ! -d "${svcdir}/restart/${myservice}" ]] && return - local x= services= scripts="$(dolisting "${svcdir}/restart/${myservice}/")" +svc_start_scheduled() { + [[ ! -d "${svcdir}/scheduled/${myservice}" ]] && return + local x= services= - for x in ${scripts} ; do + for x in $(dolisting "${svcdir}/scheduled/${myservice}/") ; do services="${services} ${x##*/}" done for x in $(trace_dependencies "${services}") ; do service_stopped "${x}" && start_service "${x}" - rm -f "${svcdir}/restart/${myservice}/${x}" + rm -f "${svcdir}/scheduled/${myservice}/${x}" done - rmdir "${svcdir}/restart/${myservice}" + rmdir "${svcdir}/scheduled/${myservice}" } svc_stop() { @@ -261,7 +261,7 @@ svc_stop() { fi fi - service_message "eerror" "FAILED to stop service ${myservice}!" + service_message "eerror" "ERROR: ${myservice} failed to stop" else # If we're stopped from a daemon that sets ${IN_BACKGROUND} such as # wpa_monitor when we mark as inactive instead of taking the down @@ -360,7 +360,7 @@ svc_start() { if ineed -t "${myservice}" "${x}" >/dev/null ; then if ! is_net_up ; then if service_inactive "${y}" ; then - svc_schedule_restart "${y}" "${myservice}" + svc_schedule_start "${y}" "${myservice}" startinactive="${y}" else startfail="${y}" @@ -378,7 +378,7 @@ svc_start() { # A 'need' dependacy is critical for startup if ineed -t "${myservice}" "${x}" >/dev/null ; then if service_inactive "${x}" ; then - svc_schedule_restart "${x}" + svc_schedule_start "${x}" startinactive="${x}" else startfail="${x}" @@ -421,6 +421,7 @@ svc_start() { # may attempt to start it again later if service_inactive "${myservice}" ; then svcinactive=0 + service_message "ewarn" "WARNING: ${myservice} has started but is inactive" end_service "${myservice}" 1 return 1 fi @@ -440,12 +441,12 @@ svc_start() { if [[ -z ${startinactive} ]] ; then is_runlevel_start && mark_service_failed "${myservice}" - service_message "eerror" "FAILED to start service ${myservice}!" + service_message "eerror" "ERROR: ${myservice} failed to start" fi else svcstarted=0 mark_service_started "${myservice}" - service_message "Service ${myservice} started OK" + service_message "Service ${myservice} started" fi end_service "${myservice}" "${retval}" @@ -563,8 +564,8 @@ done for arg in $* ; do case "${arg}" in stop) - if [[ -e "${svcdir}/restart/${myservice}" ]] ; then - rm -Rf "${svcdir}/restart/${myservice}" + if [[ -e "${svcdir}/scheduled/${myservice}" ]] ; then + rm -Rf "${svcdir}/scheduled/${myservice}" fi # Stoped from the background - treat this as a restart so that @@ -581,7 +582,7 @@ for arg in $* ; do if [[ ${IN_BACKGROUND} == "true" ]] ; then for x in $(dolisting "${svcdir}/snapshot/$$/") ; do if service_stopped "${x##*/}" ; then - svc_schedule_restart "${myservice}" "${x##*/}" + svc_schedule_start "${myservice}" "${x##*/}" fi done fi @@ -591,7 +592,7 @@ for arg in $* ; do start) svc_start retval=$? - service_started "${myservice}" && svc_start_restart + service_started "${myservice}" && svc_start_scheduled exit "${retval}" ;; needsme|ineed|usesme|iuse|broken) @@ -601,8 +602,8 @@ for arg in $* ; do svc_status ;; zap) - if [[ -e "${svcdir}/restart/${myservice}" ]] ; then - rm -f "${svcdir}/restart/${myservice}" + if [[ -e "${svcdir}/scheduled/${myservice}" ]] ; then + rm -Rf "${svcdir}/scheduled/${myservice}" fi if ! service_stopped "${myservice}" ; then einfo "Manually resetting ${myservice} to stopped state." @@ -640,18 +641,18 @@ for arg in $* ; do restart fi - [[ -e "${svcdir}/restart/${myservice}" ]] \ - && rm -f "${svcdir}/restart/${myservice}" + [[ -e "${svcdir}/scheduled/${myservice}" ]] \ + && rm -Rf "${svcdir}/scheduled/${myservice}" # Restart dependencies as well if service_inactive "${myservice}" ; then for x in $(dolisting "${svcdir}/snapshot/$$/") ; do if service_stopped "${x##*/}" ; then - svc_schedule_restart "${myservice}" "${x##*/}" + svc_schedule_start "${myservice}" "${x##*/}" fi done elif service_started "${myservice}" ; then - svc_start_restart + svc_start_scheduled fi rm -rf "${svcdir}/snapshot/$$" |