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