|
|
1.1 root 1: #
2: # @(#)rc 5.14 (sort of) (Berkeley) 5/31/90
3: #
4:
5: # System startup script run by init on autoboot
6: # or after single-user.
7: # Output and error are redirected to console by init,
8: # and the console is the controlling terminal.
9:
10: # Set shell to ignore SIGINT (2), but not children;
11: # shell catches SIGQUIT (3) and returns to single user after fsck.
12: trap : 2
13:
14: HOME=/; export HOME
15: PATH=/sbin:/bin:/usr/sbin:/usr/bin
16: export PATH
17:
18: if [ -r /fastboot ]
19: then
20: echo Fast boot ... skipping disk checks >/dev/console
21: elif [ $1x = autobootx ]
22: then
23: echo Automatic reboot in progress... >/dev/console
24: fsck -p >/dev/console 2>&1
25: case $? in
26: 0)
27: ;;
28: 2)
29: exit 1
30: ;;
31: 4)
32: reboot
33: echo "reboot failed... help!" >/dev/console
34: exit 1
35: ;;
36: 8)
37: echo "Automatic file system check failed... help!" >/dev/console
38: exit 1
39: ;;
40: 12)
41: echo "Reboot interrupted" >/dev/console
42: exit 1
43: ;;
44: 130)
45: # interrupt before catcher installed
46: exit 1
47: ;;
48: *)
49: echo "Unknown error in reboot" > /dev/console
50: exit 1
51: ;;
52: esac
53: fi
54:
55: trap "echo 'Reboot interrupted'; exit 1" 3
56:
57: swapon -a >/dev/console 2>&1
58:
59: umount -a
60: mount -a -t nonfs >/dev/console 2>&1
61: rm -f /fastboot # XXX
62:
63: # clean up left-over files
64: rm -f /etc/nologin
65: rm -f /var/spool/uucp/LCK.*
66: rm -f /var/spool/uucp/STST/*
67: (cd /var/run; rm -rf *; cp /dev/null utmp; chmod 644 utmp)
68:
69: # set hostname, turn on network
70: . /etc/netstart
71:
72: mount -a -t nfs & # XXX shouldn't need background
73:
74: echo -n 'starting system logger' >/dev/console
75: rm -f /dev/log
76: syslogd
77:
78: # $timedflags is imported from /etc/netstart;
79: # if $timedflags == NO, timed isn't run.
80: if [ X${timedflags} != X"NO" ]; then
81: echo -n ', time daemon' >/dev/console; timed $timedflags
82: fi
83: echo '.' >/dev/console
84:
85: # /var/crash should be a directory or a symbolic link
86: # to the crash directory if core dumps are to be saved.
87: if [ -d /var/crash ]; then
88: echo 'checking for core dump... ' >/dev/console
89: savecore /var/crash >/dev/console 2>&1
90: fi
91:
92: echo -n 'checking quotas:' >/dev/console
93: quotacheck -a >/dev/console 2>&1
94: echo ' done.' >/dev/console
95: quotaon -a >/dev/console 2>&1
96:
97: # build kvm database
98: kvm_mkdb >/dev/console 2>&1
99:
100: chmod 666 /dev/tty[pqrs]*
101:
102: # check the password temp/lock file
103: if [ -f /etc/ptmp ]
104: then
105: logger -s -p auth.err \
106: 'password file may be incorrect -- /etc/ptmp exists' >/dev/console 2>&1
107: fi
108:
109: echo preserving editor files >/dev/console
110: (cd /var/tmp; /usr/libexec/ex3.7preserve -a)
111: (cd /var/tmp; rm Ex[0-9][0-9][0-9][0-9][0-9] Rx[0-9][0-9][0-9][0-9][0-9])
112:
113: echo clearing /tmp >/dev/console
114: # prune quickly with one rm, then use find to clean up /tmp/[lq]*
115: (cd /tmp; rm -rf [a-km-pr-zA-Z]* )
116: (cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; )
117:
118: echo -n standard daemons: >/dev/console
119: echo -n ' update' >/dev/console; update
120: echo -n ' cron' >/dev/console; cron
121: echo -n ' accounting' >/dev/console; accton /var/account/acct
122: echo '.' >/dev/console
123:
124: echo -n starting network daemons: >/dev/console
125:
126: # $routedflags is imported from /etc/netstart;
127: # if $routedflags == NO, routed isn't run.
128: if [ X${routedflags} != X"NO" ]; then
129: echo -n ' routed' >/dev/console; routed $routedflags
130: fi
131:
132: echo -n ' named' >/dev/console; named >/dev/console 2>&1
133: echo -n ' inetd' >/dev/console; inetd
134:
135: # $rwhod is imported from /etc/netstart;
136: # if $rwhod is set to something other than NO, rwhod is run.
137: if [ ${rwhod-NO} != "NO" ]; then
138: echo -n ' rwhod' >/dev/console; rwhod
139: fi
140:
141: echo -n ' printer' >/dev/console; lpd
142: echo '.' >/dev/console
143:
144: sh /etc/rc.local
145:
146: date >/dev/console
147: exit 0
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.