/[baselayout]/trunk/sbin/rc-services.sh
Gentoo

Diff of /trunk/sbin/rc-services.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2164 Revision 2165
406 if [[ ${RC_PARALLEL_STARTUP} != "yes" || \ 406 if [[ ${RC_PARALLEL_STARTUP} != "yes" || \
407 ${START_CRITICAL} == "yes" ]] ; then 407 ${START_CRITICAL} == "yes" ]] ; then
408 # if we can not start the services in parallel 408 # if we can not start the services in parallel
409 # then just start it and return the exit status 409 # then just start it and return the exit status
410 ( "/etc/init.d/${service}" start ) 410 ( "/etc/init.d/${service}" start )
411 service_started "${service}" || service_inactive "${service}" 411 service_started "${service}" || service_inactive "${service}" \
412 || service_scheduled "${service}"
412 retval=$? 413 retval=$?
413 end_service "${service}" "${retval}" 414 end_service "${service}" "${retval}"
414 splash "svc_started" "${service}" "${retval}" 415 splash "svc_started" "${service}" "${retval}"
415 return "${retval}" 416 return "${retval}"
416 else 417 else
417 # if parallel startup is allowed, start it in background 418 # if parallel startup is allowed, start it in background
418 ( 419 (
419 "/etc/init.d/${service}" start 420 "/etc/init.d/${service}" start
420 service_started "${service}" || service_inactive "${service}" 421 service_started "${service}" || service_inactive "${service}" \
422 || service_scheduled "${service}"
421 retval=$? 423 retval=$?
422 end_service "${service}" "${retval}" 424 end_service "${service}" "${retval}"
423 splash "svc_started" "${service}" "${retval}" 425 splash "svc_started" "${service}" "${retval}"
424 ) & 426 ) &
425 return 0 427 return 0
642 service_started "$1" && return 1 644 service_started "$1" && return 1
643 service_stopping "$1" && return 1 645 service_stopping "$1" && return 1
644 service_inactive "$1" && return 1 646 service_inactive "$1" && return 1
645 647
646 return 0 648 return 0
649}
650
651# char service_scheduled_by(service)
652#
653# Returns a list of services which will try and start 'service' when they
654# are started
655#
656service_scheduled_by() {
657 [[ -z $1 ]] && return 1
658
659 local x= s= r=
660 for x in $(dolisting "${svcdir}/scheduled/*/$1") ; do
661 s="${x%/*}"
662 r="${r} ${s##*/}"
663 done
664
665 echo "${r:1}"
666}
667
668# bool service_scheduled()
669#
670# Returns true if 'service' is scheduled to be started by another service
671#
672service_scheduled() {
673 [[ -n $(service_scheduled_by "$@") ]]
647} 674}
648 675
649# bool mark_service_failed(service) 676# bool mark_service_failed(service)
650# 677#
651# Mark service as failed for current runlevel. Note that 678# Mark service as failed for current runlevel. Note that

Legend:
Removed from v.2164  
changed lines
  Added in v.2165

  ViewVC Help
Powered by ViewVC 1.1.20