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