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