diff options
Diffstat (limited to 'sbin/init.linux.sh')
-rwxr-xr-x | sbin/init.linux.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sbin/init.linux.sh b/sbin/init.linux.sh new file mode 100755 index 0000000..338f7cb --- /dev/null +++ b/sbin/init.linux.sh @@ -0,0 +1,43 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# void single_user() +# +# Drop to a shell, remount / ro, and then reboot +# +single_user() { + einfo "Rebooting" + /sbin/reboot -f +} + +source "${svclib}"/sh/init-functions.sh +source "${svclib}"/sh/init-common-pre.sh + +echo +echo -e "${GOOD}Gentoo Linux${GENTOO_VERS}; ${BRACKET}http://www.gentoo.org/${NORMAL}" +echo -e " Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2" +echo +echo -e "Press ${GOOD}I${NORMAL} to enter interactive boot mode" +echo + +check_statedir /proc +check_statedir /dev + +source "${svclib}"/sh/init-common-post.sh + +# Setup login records ... this has to be done here because when +# we exit this runlevel, init will write a boot record to utmp +# If /var/run is readonly, then print a warning, not errors +if touch /var/run/utmp 2>/dev/null ; then + > /var/run/utmp + touch /var/log/wtmp + chgrp utmp /var/run/utmp /var/log/wtmp + chmod 0664 /var/run/utmp /var/log/wtmp + # Remove /var/run/utmpx (bug from the past) + rm -f /var/run/utmpx +else + ewarn "Skipping /var/run/utmp initialization (ro root?)" +fi + + +# vim:ts=4 |