/[baselayout]/trunk/sbin/rc
Gentoo

Diff of /trunk/sbin/rc

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

Revision 398 Revision 399
438 local dep= 438 local dep=
439 local needsme= 439 local needsme=
440 local myservice="${1##*/}" 440 local myservice="${1##*/}"
441 local depservice= 441 local depservice=
442 442
443 [ ! -L "${svcdir}/started/${myservice}" ] && continue 443 if ! service_started "${myservice}"
444
445 if [ ! -e "${svcdir}/started/${myservice}" ]
446 then 444 then
447 # Remove dud symlinks 445 return 0
448 rm -f "${svcdir}/started/${myservice}"
449
450 continue
451 fi 446 fi
452 447
453 # Candidate for zapping 448 # Candidate for zapping
454 if [ ! -L "${svcdir}/softscripts.new/${myservice}" ] 449 if [ ! -L "${svcdir}/softscripts.new/${myservice}" ]
455 then 450 then
466 if [ -n "${OLDSOFTLEVEL}" ] && \ 461 if [ -n "${OLDSOFTLEVEL}" ] && \
467 ! in_runlevel "${myservice}" "${OLDSOFTLEVEL}" 462 ! in_runlevel "${myservice}" "${OLDSOFTLEVEL}"
468 then 463 then
469 # This service is not in the previous runlevel, so 464 # This service is not in the previous runlevel, so
470 # do not stop it ... 465 # do not stop it ...
471 continue 466 return 0
472 fi 467 fi
473 fi 468 fi
474 469
475 # Should not work for 'use' 470 # Should not work for 'use'
476 if [ -z "$(needsme "${myservice}")" ] 471 if [ -z "$(needsme "${myservice}")" ]
531 # First stop non critical services 526 # First stop non critical services
532 for i in $(dolisting "${svcdir}/started/") 527 for i in $(dolisting "${svcdir}/started/")
533 do 528 do
534 if [ -n "${LOGGER_SERVICE}" ] 529 if [ -n "${LOGGER_SERVICE}" ]
535 then 530 then
536 # Do not stop it if it depends on the logger 531 # Only stop it if the logger do not depends on it
537 if query_before "${i##*/}" "${LOGGER_SERVICE}" 532 if ! query_before "${i##*/}" "${LOGGER_SERVICE}"
538 then 533 then
539 # Same if it is a critical service 534 continue
540 is_critical_service "${i}" || dep_stop "${i}"
541 fi 535 fi
542 else 536 fi
537
538 # Do not stop critical services just yet
543 is_critical_service "${i}" || dep_stop "${i}" 539 is_critical_service "${i}" || dep_stop "${i}"
544 fi
545 done 540 done
546 541
547 # Now stop the logger if running 542 # Now stop the logger if running
548 if [ -n "${LOGGER_SERVICE}" ] 543 if [ -n "${LOGGER_SERVICE}" ]
549 then 544 then
550 service_started "${LOGGER_SERVICE}" && dep_stop "${LOGGER_SERVICE}" 545 dep_stop "${LOGGER_SERVICE}"
551 fi 546 fi
552 547
553 # Now stop the rest 548 # Now stop the rest
554 for i in $(dolisting "${svcdir}/started/") 549 for i in $(dolisting "${svcdir}/started/")
555 do 550 do

Legend:
Removed from v.398  
changed lines
  Added in v.399

  ViewVC Help
Powered by ViewVC 1.1.20