summaryrefslogtreecommitdiff
blob: 6c147650ef97fc035470a4efaf7dc9921000efc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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

# openvz workaround
# /proc/self exists:        we're on linux-vserver
# /proc/self doesn't exist: we're on openvz
[[ -e /proc/self ]] || "${svclib}"/ovz-mount-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