Commit | Line | Data |
---|---|---|
8c5cf0c6 KB |
1 | # |
2 | # @(#)rc 5.3 (Berkeley) %G% | |
3 | # | |
4 | ||
aa77a7dd | 5 | HOME=/; export HOME |
8c5cf0c6 | 6 | PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/ucb |
1a91d88f | 7 | export PATH |
aa77a7dd KB |
8 | |
9 | if [ -r /fastboot ] | |
10 | then | |
11 | rm -f /fastboot | |
12 | echo Fast boot ... skipping disk checks >/dev/console | |
13 | elif [ $1x = autobootx ] | |
14 | then | |
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 | |
41 | else | |
42 | date >/dev/console | |
43 | fi | |
44 | ||
8c5cf0c6 | 45 | # check the password file |
1a91d88f | 46 | if [ -f /etc/ptmp ] |
aa77a7dd | 47 | then |
8c5cf0c6 | 48 | echo '/etc/ptmp -- password file may be incorrect' > /dev/console |
aa77a7dd KB |
49 | fi |
50 | ||
51 | umount -a | |
52 | : >/etc/mtab | |
53 | swapon -a >/dev/console 2>&1 | |
54 | mount -a >/dev/console 2>&1 | |
55 | ||
56 | echo -n 'checking quotas:' >/dev/console | |
57 | quotacheck -a -p >/dev/console 2>&1 | |
58 | echo ' done.' >/dev/console | |
59 | quotaon -a | |
60 | ||
8c5cf0c6 | 61 | # build ps data base |
aa77a7dd | 62 | ps -U >/dev/console 2>&1 |
8c5cf0c6 KB |
63 | |
64 | # clean up left-over files | |
aa77a7dd KB |
65 | rm -f /etc/nologin |
66 | rm -f /usr/spool/uucp/LCK.* | |
67 | rm -f /usr/spool/uucp/STST/* | |
8c5cf0c6 | 68 | |
aa77a7dd KB |
69 | chmod 666 /dev/tty[pqrs]* |
70 | ||
71 | # set hostname, turn on network | |
72 | . /etc/netstart | |
73 | ||
74 | echo 'starting system logger' >/dev/console | |
75 | rm -f /dev/log | |
76 | syslogd | |
77 | ||
78 | # /var/crash should be a symbolic link to the crash directory | |
79 | # if core dumps are to be saved. | |
80 | if [ -d /var/crash ]; then | |
81 | echo 'checking for core dump... ' >/dev/console | |
82 | savecore /var/crash >/dev/console 2>&1 | |
83 | fi | |
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 | |
93 | update; echo -n ' update' >/dev/console | |
94 | cron; echo -n ' cron' >/dev/console | |
95 | accton /usr/adm/acct; echo -n ' accounting' >/dev/console | |
96 | echo '.' >/dev/console | |
97 | ||
98 | echo -n starting network daemons: >/dev/console | |
99 | ||
100 | # $routedflags is imported from /etc/netstart; | |
101 | # if $routedflags == NO, routed isn't run. | |
102 | if [ X${routedflags} != X"NO" ]; then | |
103 | routed $routedflags; echo -n ' routed' >/dev/console | |
104 | fi | |
105 | ||
106 | { echo -n ' named'; named; } >/dev/console | |
107 | inetd; 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. | |
111 | if [ ${rwhod-NO} != "NO" ]; then | |
112 | rwhod; echo -n ' rwhod' >/dev/console | |
113 | fi | |
114 | ||
aa77a7dd KB |
115 | /usr/lib/lpd; echo -n ' printer' >/dev/console |
116 | echo '.' >/dev/console | |
117 | ||
118 | sh /etc/rc.local | |
119 | ||
120 | date >/dev/console | |
121 | exit 0 |