# Copyright 1999-2006 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-2006 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 # OpenVZ needs to mount proc from inside if [[ ! -e /proc/self ]]; then mount -t proc none /proc fi # OpenVZ also needs devpts for vzctl enter if [[ ! -e /dev/pts/0 ]]; then have_devpts="$(awk '($2 == "devpts") { print "yes"; exit 0 }' /proc/filesystems)" if [ "${have_devpts}" = "yes" ] ; then # Make sure we have /dev/pts mkdir -p /dev/pts &>/dev/null || \ ewarn "Could not create /dev/pts!" if [[ -d /dev/pts ]] ; then ebegin "Mounting devpts at /dev/pts" mount -n -t devpts -o gid=5,mode=0620 devpts /dev/pts eend $? fi fi fi 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