summaryrefslogtreecommitdiff
path: root/static/unix-v10/man8/rc.8
blob: f46cff12b402e81f5b84b656f7bebf22689369b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
.TH RC 8
.CT 1 sa_auto
.SH NAME
rc \- boot script
.SH SYNOPSIS
.B /etc/rc
.SH DESCRIPTION
.I Rc
is the command script
invoked by
.IR init (8)
to control reboots.
During an automatic reboot,
.I rc
is invoked with the argument
.BR autoboot ;
typically this invokes
.L /etc/fsck -p
to repair minor filesystem inconsistencies.
If
.I rc
exits with a successful status,
.I init
proceeds to multi-user mode.
.PP
When the system enters multi-user mode,
either during an auto-reboot
or after the single-user shell terminates,
.I rc
is invoked without arguments.
This usually causes it to
mount filesystems,
start daemons,
clear
.FR /tmp ,
and perform other housekeeping.
.PP
If any call to
.I rc
returns a nonzero status,
.I init
reverts to single-user mode.
.SH EXAMPLES
A typical
.I rc
script:
.PP
.EX
date
case $1 in
autoboot)
	echo Autoboot:
	/etc/fsck -p || {echo "error in reboot"; exit 1}
esac
/etc/ldpcs /etc/pcs750.bin
>/etc/mtab
/etc/mount -a
/etc/savecore /tmp/dump /dev/ra11
/etc/swapon -a
trap "" 1 2 3
/etc/update
/etc/cron &
rm -f /tmp/*
/usr/lib/asd/rmlocks
date >> /usr/adm/lastboot
/etc/accton /tmp/acct > /tmp/acct
/usr/ipc/mgrs/svcmgr
/etc/kdiload
/usr/ipc/mgrs/dkhup; sleep 10
/usr/ipc/mgrs/dkmgr
/usr/netb/setup.go
/usr/net/face.go
wwv -s
.EE
.SH SEE ALSO
.IR init (8), 
.IR reboot (8)