summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorBenedikt Boehm <hollow@gentoo.org>2005-09-04 13:32:48 +0000
committerBenedikt Boehm <hollow@gentoo.org>2005-09-04 13:32:48 +0000
commit0f1cf7913b1b2009539aa2ae9c111851ed2920e7 (patch)
tree7543ac44c142774bd057b57791bd45768dc93526 /sbin
parentadd back some lines (diff)
downloadbaselayout-vserver-0f1cf7913b1b2009539aa2ae9c111851ed2920e7.tar.gz
baselayout-vserver-0f1cf7913b1b2009539aa2ae9c111851ed2920e7.tar.bz2
baselayout-vserver-0f1cf7913b1b2009539aa2ae9c111851ed2920e7.zip
remove bootlog; support gentoo init style; fix minor bugs
svn path=/baselayout-vserver/trunk/; revision=34
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/functions.sh1
-rwxr-xr-xsbin/rc30
-rwxr-xr-xsbin/rc-services.sh2
3 files changed, 19 insertions, 14 deletions
diff --git a/sbin/functions.sh b/sbin/functions.sh
index 1cb1c08..e9bf234 100755
--- a/sbin/functions.sh
+++ b/sbin/functions.sh
@@ -81,7 +81,6 @@ profiling() {
bootlog() {
return 0
}
-[[ ${RC_BOOTLOG} == "yes" ]] && import_addon bootlogger.sh
# void get_bootconfig()
#
diff --git a/sbin/rc b/sbin/rc
index c11c563..13cff6a 100755
--- a/sbin/rc
+++ b/sbin/rc
@@ -44,10 +44,13 @@ get_critical_services() {
# Save $1
argv1="$1"
+# we need this to prevent a warning below
+[[ ! -e ${svcdir}/softlevel ]] && touch ${svcdir}/softlevel
+
# First time boot stuff goes here. Note that 'sysinit' is an internal runlevel
# used to bring up local filesystems, and should not be started with /sbin/rc
# directly ...
-if [[ ${argv1} = "sysinit" ]]
+if [[ ${argv1} = "sysinit" || ( ${argv1} = "boot" && "$(<${svcdir}/softlevel)" != "sysinit" ) ]]
then
# Setup initial $PATH just in case
PATH="/bin:/sbin:/usr/bin:/usr/sbin:${PATH}"
@@ -60,9 +63,6 @@ then
check_statedir /proc
check_statedir /dev
- # Start logging console output since we have all /dev stuff setup
- bootlog start
-
# We set the forced softlevel from the kernel command line
# It needs to be run right after proc is mounted for the
# boot runlevel
@@ -114,9 +114,6 @@ then
unset START_CRITICAL
- # /var/log should be writable now, so starting saving the boot output
- bootlog sync
-
# Check that $svcdir exists ...
check_statedir "${svcdir}"
@@ -157,10 +154,7 @@ then
ewarn "Skipping /var/run/utmp initialization (ro root?)"
fi
- # All done logging
- bootlog quit
-
- exit 0
+ [[ ${argv1} = "boot" ]] || exit 0
fi # Sysinit ends here
if [[ ${argv1} == "boot" ]]
@@ -353,6 +347,12 @@ if [[ ${SOFTLEVEL} == "reboot" || ${SOFTLEVEL} == "shutdown" ]] ; then
source /etc/init.d/halt.sh
+ # we just die here since we have no init
+ # and we should be the last running process
+ if [[ ${RC_INITSTYLE_HACK} == "yes" ]] ; then
+ exit 0
+ fi
+
if [[ ${SOFTLEVEL} == "reboot" ]] ; then
source /etc/init.d/reboot.sh
else
@@ -403,7 +403,13 @@ rm -rf "${svcdir}/softscripts.old" &>/dev/null
rm -rf "${svcdir}/failed" &>/dev/null
# If we were in the boot runlevel, it is done now ...
-[[ -n ${BOOT} ]] && unset BOOT
+if [[ -n ${BOOT} ]] ; then
+ unset BOOT
+
+ if [[ "${RC_INITSTYLE_HACK}" = "yes" ]]; then
+ /sbin/rc default
+ fi
+fi
# Remove the cached CONSOLETYPE
unset CONSOLETYPE
diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh
index d75b91c..d928a5f 100755
--- a/sbin/rc-services.sh
+++ b/sbin/rc-services.sh
@@ -628,7 +628,7 @@ valid_i() {
for x in $( i$1 "$2" )
do
[[ -e "/etc/runlevels/${BOOTLEVEL}/${x}" \
- || -e "/etc/runlevels/${mylevel}/${x}" \
+ || -e "/etc/runlevels/${mylevel}/${x}" ]] \
&& echo "${x}"
done