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