# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # We set the forced softlevel from the kernel command line # It needs to be run right after proc is mounted for the # boot runlevel setup_defaultlevels # $BOOT can be used by rc-scripts to test if it is the first time # the 'boot' runlevel is executed. Now also needed by some stuff in # the 'sysinit' runlevel ... export BOOT="yes" # We first try to find a locally defined list of critical services # for a particular runlevel. If we cannot find it, we use the # defaults. get_critical_services export START_CRITICAL="yes" # We do not want to break compatibility, so we do not fully integrate # these into /sbin/rc, but rather start them by hand ... for x in ${CRITICAL_SERVICES} ; do if ! start_critical_service "${x}" ; then echo eerror "One of more critical startup scripts failed to start!" einfo "Rebooting" /sbin/reboot -f fi done unset START_CRITICAL # Check that $svcdir exists ... check_statedir "${svcdir}" # Clear $svcdir from stale entries, but leave the caches around, as it # should help speed things up a bit rm -rf $(ls -d1 "${svcdir}/"* 2>/dev/null | \ grep -ve '\(depcache\|deptree\|envcache\)') echo "sysinit" > "${svcdir}/softlevel" # Ensure all critical services have are in the boot runlevel check_critical_services # Update the dependency cache /sbin/depscan.sh # Now that the dependency cache are up to date, make sure these # are marked as started ... ( # Needed for mark_service_started() source "${svclib}"/sh/rc-services.sh for x in ${CRITICAL_SERVICES} ; do mark_service_started "${x}" done ) # sysinit is now done, so allow init scripts to run normally [[ -e /dev/.rcsysinit ]] && rm -f /dev/.rcsysinit # vim:ts=4