]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/rcorder/rcorder.8
Add UPDATING entries and bump version.
[FreeBSD/FreeBSD.git] / sbin / rcorder / rcorder.8
1 .\"     $NetBSD: rcorder.8,v 1.3 2000/07/17 14:16:22 mrg Exp $
2 .\"
3 .\" Copyright (c) 1998
4 .\"     Perry E. Metzger.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgment:
16 .\"     This product includes software developed for the NetBSD Project
17 .\"     by Perry E. Metzger.
18 .\" 4. The name of the author may not be used to endorse or promote products
19 .\"    derived from this software without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd June 22, 2020
35 .Dt RCORDER 8
36 .Os
37 .Sh NAME
38 .Nm rcorder
39 .Nd print a dependency ordering of interdependent files
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl k Ar keep
43 .Op Fl s Ar skip
44 .Ar
45 .Sh DESCRIPTION
46 The
47 .Nm
48 utility is designed to print out a dependency ordering of a set of
49 interdependent files.
50 Typically it is used to find an execution
51 sequence for a set of shell scripts in which certain files must be
52 executed before others.
53 .Pp
54 Each file passed to
55 .Nm
56 must be annotated with special lines (which look like comments to the
57 shell) which indicate the dependencies the files have upon certain
58 points in the sequence, known as
59 .Dq conditions ,
60 and which indicate, for each file, which
61 .Dq conditions
62 may be expected to be filled by that file.
63 .Pp
64 Within each file, a block containing a series of
65 .Ql REQUIRE ,
66 .Ql PROVIDE ,
67 .Ql BEFORE
68 and
69 .Ql KEYWORD
70 lines must appear.
71 The format of the lines is rigid.
72 Each line must begin with a single
73 .Ql # ,
74 followed by a single space, followed by
75 .Ql PROVIDE\&: ,
76 .Ql REQUIRE\&: ,
77 .Ql BEFORE\&: ,
78 or
79 .Ql KEYWORD\&: .
80 No deviation is permitted.
81 Each dependency line is then followed by a series of conditions,
82 separated by whitespace.
83 Multiple
84 .Ql PROVIDE ,
85 .Ql REQUIRE ,
86 .Ql BEFORE
87 and
88 .Ql KEYWORD
89 lines may appear, but all such lines must appear in a sequence without
90 any intervening lines, as once a line that does not follow the format
91 is reached, parsing stops.
92 .\" Note that for historical reasons REQUIRES, PROVIDES, and KEYWORDS
93 .\" are also accepted in addition to the above, but not documented so
94 .\" that they can be deprecated at some point in the future.
95 .Pp
96 The options are as follows:
97 .Bl -tag -width "-k keep"
98 .It Fl k Ar keep
99 Add the specified keyword to the
100 .Dq "keep list" .
101 If any
102 .Fl k
103 option is given, only those files containing the matching keyword are listed.
104 This option can be specified multiple times.
105 .It Fl s Ar skip
106 Add the specified keyword to the
107 .Dq "skip list" .
108 If any
109 .Fl s
110 option is given, files containing the matching keyword are not listed.
111 This option can be specified multiple times.
112 .El
113 .Pp
114 An example block follows:
115 .Bd -literal -offset indent
116 # REQUIRE: networking syslog
117 # REQUIRE: usr
118 # PROVIDE: dns nscd
119 .Ed
120 .Pp
121 This block states that the file in which it appears depends upon the
122 .Ql networking ,
123 .Ql syslog ,
124 and
125 .Ql usr
126 conditions, and provides the
127 .Ql dns
128 and
129 .Ql nscd
130 conditions.
131 .Pp
132 A file may contain zero
133 .Ql PROVIDE
134 lines, in which case it provides no conditions, and may contain zero
135 .Ql REQUIRE
136 lines, in which case it has no dependencies.
137 There must be at least one file with no dependencies in the set of
138 arguments passed to
139 .Nm
140 in order for it to find a starting place in the dependency ordering.
141 .Sh KEYWORDS
142 There are several
143 .Em KEYWORDs
144 in use:
145 .Bl -tag -width "shutdown" -offset indent
146 .It Sy firstboot , nojail , nojailvnet , nostart
147 Used by
148 .Xr rc 8 .
149 .It Sy resume
150 Used by
151 .Nm /etc/rc.resume
152 (see
153 .Xr acpiconf 8 )
154 .It Sy shutdown
155 Used by
156 .Xr rc.shutdown 8 .
157 .El
158 .Sh EXAMPLES
159 Print the dependency ordering of the services from the base system and
160 .Xr ports 7 :
161 .Bd -literal -offset indent
162 $ rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
163 .Ed
164 .Pp
165 Count the number of services in the base system, which specify the
166 .Sy shutdown
167 keyword, while skipping those with
168 .Sy firstboot
169 and
170 .Sy nojailvnet :
171 .Bd -literal -offset indent
172 $ rcorder -k nostart -s firstboot -s nojailvnet /etc/rc.d/*  | wc -l
173        3
174 .Ed
175 .Sh DIAGNOSTICS
176 The
177 .Nm
178 utility may print one of the following error messages and exit with a non-zero
179 status if it encounters an error while processing the file list.
180 .Bl -diag
181 .It "Requirement %s has no providers, aborting."
182 No file has a
183 .Ql PROVIDE
184 line corresponding to a condition present in a
185 .Ql REQUIRE
186 line in another file.
187 .It "Circular dependency on provision %s, aborting."
188 A set of files has a circular dependency which was detected while
189 processing the stated condition.
190 .It "Circular dependency on file %s, aborting."
191 A set of files has a circular dependency which was detected while
192 processing the stated file.
193 .El
194 .Sh SEE ALSO
195 .Xr acpiconf 8 ,
196 .Xr rc 8 ,
197 .Xr rc.shutdown 8 ,
198 .Xr service 8
199 .Sh HISTORY
200 The
201 .Nm
202 utility appeared in
203 .Nx 1.5 .
204 .Nm
205 utility first appeared in
206 .Fx 5.0 .
207 .Sh AUTHORS
208 .An -nosplit
209 Written by
210 .An Perry E. Metzger Aq Mt perry@piermont.com
211 and
212 .An Matthew R. Green Aq Mt mrg@eterna.com.au .
213 .Sh BUGS
214 The
215 .Ql REQUIRE
216 keyword is misleading:
217 It does not describe which daemons have to be running before a script
218 will be started.
219 It describes which scripts must be placed before it in
220 the dependency ordering.
221 For example,
222 if your script has a
223 .Ql REQUIRE
224 on
225 .Ql sshd ,
226 it means the script must be placed after the
227 .Ql sshd
228 script in the dependency ordering,
229 not necessarily that it requires
230 .Nm sshd
231 to be started or enabled.