xref: /original-bsd/etc/rc (revision 07d71086)
1#
2#	@(#)rc	5.4 (Berkeley) 08/15/89
3#
4
5HOME=/; export HOME
6PATH=/sbin:/bin:/usr/sbin:/usr/bin
7export PATH
8
9if [ -r /fastboot ]
10then
11	rm -f /fastboot
12	echo Fast boot ... skipping disk checks >/dev/console
13elif [ $1x = autobootx ]
14then
15	echo Automatic reboot in progress... 		>/dev/console
16	fsck -p						>/dev/console 2>&1
17	case $? in
18	0)
19		;;
20	2)
21		exit 1
22		;;
23	4)
24		reboot -n
25		;;
26	8)
27		echo "Automatic reboot failed... help!" >/dev/console
28		exit 1
29		;;
30	12)
31		echo "Reboot interrupted" >/dev/console
32		exit 1
33		;;
34	*)
35		echo "Unknown error in reboot" > /dev/console
36		exit 1
37		;;
38	esac
39fi
40
41# check the password file
42if [ -f /etc/ptmp ]
43then
44	echo 'password file may be incorrect -- /etc/ptmp exists' \
45	    > /dev/console
46fi
47
48umount -a
49: >/etc/mtab
50swapon -a						>/dev/console 2>&1
51mount -a						>/dev/console 2>&1
52
53			echo -n 'checking quotas:'	>/dev/console
54quotacheck -a -p					>/dev/console 2>&1
55			echo ' done.'			>/dev/console
56quotaon -a
57
58# build ps data base
59ps -U							>/dev/console 2>&1
60
61# clean up left-over files
62rm -f /etc/nologin
63rm -f /usr/spool/uucp/LCK.*
64rm -f /usr/spool/uucp/STST/*
65(cd /var/run; rm -rf *)
66
67chmod 666 /dev/tty[pqrs]*
68
69# set hostname, turn on network
70. /etc/netstart
71
72echo 'starting system logger'	>/dev/console
73rm -f /dev/log
74syslogd
75
76# /var/crash should be a directory or a symbolic link
77# to the crash directory if core dumps are to be saved.
78if [ -d /var/crash ]; then
79	echo 'checking for core dump... '	>/dev/console
80 	savecore /var/crash			>/dev/console 2>&1
81fi
82
83echo preserving editor files  >/dev/console
84(cd /tmp; /usr/libexec/ex3.7preserve -a)
85echo clearing /tmp 	>/dev/console
86(cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; )
87
88echo -n standard daemons: >/dev/console
89echo -n ' update'	>/dev/console;	update
90echo -n ' cron'		>/dev/console;	cron
91echo -n ' accounting'	>/dev/console;	accton /var/account/acct
92echo    '.'		>/dev/console
93
94echo -n starting network daemons: >/dev/console
95
96# $routedflags is imported from /etc/netstart;
97# if $routedflags == NO, routed isn't run.
98if [ X${routedflags} != X"NO" ]; then
99    echo -n ' routed'	>/dev/console; routed $routedflags
100fi
101
102echo -n ' named'	>/dev/console;	named >/dev/console 2>&1
103echo -n ' inetd'	>/dev/console;	inetd
104
105# $rwhod is imported from /etc/netstart;
106# if $rwhod is set to something other than NO, rwhod is run.
107if [ ${rwhod-NO} != "NO" ]; then
108    echo -n ' rwhod'	>/dev/console;	rwhod
109fi
110
111echo -n ' printer'	>/dev/console;	lpd
112echo    '.'		>/dev/console
113
114sh /etc/rc.local
115
116date			>/dev/console
117exit 0
118