Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 133264 | Differences between
and this patch

Collapse All | Expand All

(-)sbin/rc (-18 / +18 lines)
Lines 684-692 Link Here
684
		# As we're in the bootlevel, add any services that failed due
684
		# As we're in the bootlevel, add any services that failed due
685
		# to /dev/.rcsysinit existing to the list
685
		# to /dev/.rcsysinit existing to the list
686
		if [[ -d /dev/.rcboot ]] ; then
686
		if [[ -d /dev/.rcboot ]] ; then
687
			COLDPLUG_SERVICES=
687
			for x in $(dolisting /dev/.rcboot/) ; do
688
			for x in $(dolisting /dev/.rcboot/) ; do
688
				[[ -L ${x} ]] && myscripts="${myscripts} ${x##*/}"
689
				[[ -L ${x} ]] && COLDPLUG_SERVICES="${COLDPLUG_SERVICES} ${x##*/}"
689
			done
690
			done
691
			for x in ${COLDPLUG_SERVICES} ; do
692
				if [[ ! -e /etc/runlevels/"${BOOTLEVEL}"/"${x}" \
693
				&& ! -e /etc/runlevels/"${DEFAULTLEVEL}"/"${x}" ]] ; then
694
					myscripts="${myscripts} ${x}"
695
					mark_service_coldplugged "${x}"
696
				fi
697
			done
690
			einfo "Device initiated services:${HILITE}${myscripts}${NORMAL}"
698
			einfo "Device initiated services:${HILITE}${myscripts}${NORMAL}"
691
			rm -rf /dev/.rcboot
699
			rm -rf /dev/.rcboot
692
		fi
700
		fi
Lines 737-760 Link Here
737
	service_stopped "${service}" && return 0
745
	service_stopped "${service}" && return 0
738
	
746
	
739
	# Candidate for zapping ?
747
	# Candidate for zapping ?
740
	[[ ! -L ${svcdir}/softscripts.new/${service} ]] || \
748
	[[ -L ${svcdir}/softscripts.new/${service} ]] \
741
		return 0
749
		&& return 0
742
750
743
	# If this is a 'net' service, we do not want to stop it if it was
751
	if [[ ${SOFTLEVEL} != "reboot" \
744
	# not in the previous runlevel, and we are not shutting down,
752
	      && ${SOFTLEVEL} != "shutdown" \
745
	# rebooting or going to single runlevel.  This is because the user
753
	      && ${SOFTLEVEL} != "single" ]] ; then
746
	# (or hotplut) might have started it (net.ppp?) ...
754
	      	service_coldplugged "${service}" && return 0
747
	if net_service "${service}" && \
755
		[[ -z ${OLDSOFTLEVEL} ]] \
748
	   [[ ${SOFTLEVEL} != "reboot" && \
756
			|| ! in_runlevel "${service}" "${OLDSOFTLEVEL}" \
749
	      ${SOFTLEVEL} != "shutdown" && \
757
			&& return 0
750
	      ${SOFTLEVEL} != "single" ]] ; then
751
		if [[ -z ${OLDSOFTLEVEL} ]] || \
752
		   ! in_runlevel "${service}" "${OLDSOFTLEVEL}"
753
		then
754
			# This service is not in the previous runlevel, so
755
			# do not stop it ...
756
			return 0
757
		fi
758
	fi
758
	fi
759
759
760
	# Should not work for 'use'
760
	# Should not work for 'use'
(-)sbin/rc-services.sh (-2 / +21 lines)
Lines 478-483 Link Here
478
	fi
478
	fi
479
}
479
}
480
480
481
# bool mark_service_coldplugged(service)
482
#
483
#   Mark 'service' as coldplugged.
484
#
485
mark_service_coldplugged() {
486
	[[ -z $1 ]] && return 1
487
488
	ln -snf "/etc/init.d/$1" "${svcdir}/coldplugged/$1"
489
	return 0
490
}
491
481
# bool mark_service_starting(service)
492
# bool mark_service_starting(service)
482
#
493
#
483
#   Mark 'service' as starting.
494
#   Mark 'service' as starting.
Lines 550-556 Link Here
550
	rm -Rf "${svcdir}/daemons/$1" "${svcdir}/starting/$1" \
561
	rm -Rf "${svcdir}/daemons/$1" "${svcdir}/starting/$1" \
551
		"${svcdir}/started/$1" "${svcdir}/inactive/$1" \
562
		"${svcdir}/started/$1" "${svcdir}/inactive/$1" \
552
		"${svcdir}/wasinactive/$1" "${svcdir}/stopping/$1" \
563
		"${svcdir}/wasinactive/$1" "${svcdir}/stopping/$1" \
553
		"${svcdir}/scheduled/$1" "${svcdir}/options/$1"
564
		"${svcdir}/scheduled/$1" "${svcdir}/options/$1" \
565
		"${svcdir}/coldplugged/$1"
554
566
555
	return 0
567
	return 0
556
}
568
}
Lines 571-576 Link Here
571
	return 1
583
	return 1
572
}
584
}
573
585
586
# bool service_coldplugged(service)
587
#
588
#   Returns true if 'service' is coldplugged
589
#
590
service_coldplugged() {
591
	test_service_state "$1" "coldplugged"
592
}
593
574
# bool service_starting(service)
594
# bool service_starting(service)
575
#
595
#
576
#   Returns true if 'service' is starting
596
#   Returns true if 'service' is starting
Lines 730-736 Link Here
730
		   ${x} == "net" ]] \
750
		   ${x} == "net" ]] \
731
				&& echo "${x}"
751
				&& echo "${x}"
732
	done
752
	done
733
734
	return 0
753
	return 0
735
}
754
}
736
755

Return to bug 133264