summaryrefslogtreecommitdiff
path: root/man/rc-depend.8
blob: 62aa9592c90555f7b22e532ccf077b3471eb9d59 (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
.TH "BASELAYOUT" "8" "March 2007" "baselayout" "baselayout"
.SH NAME
rc-depend \ - resolve init script dependencies
.SH SYNOPSIS
\fBrc-depend\fR \fI-ineed\fR \fI-iuse\fR \fIservice\fR ...
.br
\fBrc-depend\fR \fI--notrace\fR \fI-iprovide\fR \fIservice\fR ...
.br
\fBrc-depend\fR \fI-needsme\fR \fIservice\fR ...
.br
\fBrc-depend\fR \fI--update\fR
.SH DESCRIPTION
Gentoos init system uses service dependencies to depend on other services.
Rather than just starting in a set order, we start and stop in the order
defined by the services themselves.
For example, most services require local disks to be mounted and as such can
depend on the localmount service. Others depend on and net and dns and will
only start when those dependencies have been satisfied.

One issue of note is that a service can provide another service, which is more
generic. A good example of this is that net.lo and any service linked to it 
provide "net", which a few services depend on. You can of course have a few
network interfaces: modern laptops have 3 being loopback, wired and wireless.
What makes this more interesting is that it could be setup so that both wired
and wireless are optional. So we work out provided services like so :-

1) Always use any services in the runlevel.
.br
2) If no services are defined in the runlevel then use any running services
that satisfy the provide.
.br
3) Append any services in the boot runlevel.

\fBrc-order\fR is primarily used internally by Gentoo and is not meant as an
end-user or admin tool. This man page is purely to describe its function.
.SH OPTIONS
.TP
\fB--deptree \fIdeptree\fR
Use this \fIdeptree\fR instead of the default one,
\fI/lib/rcscripts/init.d/deptree\fR.
.TP
\fB--notrace\fR
Just show the dependencies for the specified services without working out
anything extra.
.TP
\fB--strict\fR
For provided services, depend on all of them in the runlevel instead of just
ones that are started.
.TP
\fB--update\fR
Force an update of the dependency tree. Normally this is not needed as we
automatically update the dependency tree if any files in /etc/init.d or
/etc/conf.d are newer than the tree.
.TP
\fB-dependency_type\fR
Work with the specified dependency type, such as \fIineed\fR, \fIiafter\fR,
\fIneedsme\fR.
If none are supplied we default to \fIineed\fR and \fIiuse\fR.
.SH NOTES
When needsme depends on a provided service, like net, we don't do any
mapping to an actual service unless it's the last one up. So if net.lo and
net.eth0 are started then neither are returned. If net.eth0 then stops then
every service that needs net then has net.lo in its needsme list so that
we net.lo stops it brings down all services that depend on net.
.SH BUGS
Provided services are calculated at runtime. The current downside of this
approach means that if you do "after net; before net.lo" and net.lo provides
net then you can get into an sticky loop where services hang.
.SH "REPORTING BUGS"
Please report bugs via http://bugs.gentoo.org/
.SH "SEE ALSO"
.BR rc-update (8),
.BR rc-status (8)