xref: /freebsd/sbin/rcorder/rcorder.8 (revision 31f6889564a45a6793d0e26f3da3d3009648dd39)
1d9bc822fSDavid E. O'Brien.\"	$NetBSD: rcorder.8,v 1.3 2000/07/17 14:16:22 mrg Exp $
29d62501fSDavid E. O'Brien.\"
39d62501fSDavid E. O'Brien.\" Copyright (c) 1998
49d62501fSDavid E. O'Brien.\"	Perry E. Metzger.  All rights reserved.
59d62501fSDavid E. O'Brien.\"
69d62501fSDavid E. O'Brien.\" Redistribution and use in source and binary forms, with or without
79d62501fSDavid E. O'Brien.\" modification, are permitted provided that the following conditions
89d62501fSDavid E. O'Brien.\" are met:
99d62501fSDavid E. O'Brien.\" 1. Redistributions of source code must retain the above copyright
109d62501fSDavid E. O'Brien.\"    notice, this list of conditions and the following disclaimer.
119d62501fSDavid E. O'Brien.\" 2. Redistributions in binary form must reproduce the above copyright
129d62501fSDavid E. O'Brien.\"    notice, this list of conditions and the following disclaimer in the
139d62501fSDavid E. O'Brien.\"    documentation and/or other materials provided with the distribution.
149d62501fSDavid E. O'Brien.\" 3. All advertising materials mentioning features or use of this software
159d62501fSDavid E. O'Brien.\"    must display the following acknowledgment:
169d62501fSDavid E. O'Brien.\"	This product includes software developed for the NetBSD Project
179d62501fSDavid E. O'Brien.\"	by Perry E. Metzger.
189d62501fSDavid E. O'Brien.\" 4. The name of the author may not be used to endorse or promote products
199d62501fSDavid E. O'Brien.\"    derived from this software without specific prior written permission.
209d62501fSDavid E. O'Brien.\"
219d62501fSDavid E. O'Brien.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
229d62501fSDavid E. O'Brien.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
239d62501fSDavid E. O'Brien.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
249d62501fSDavid E. O'Brien.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
259d62501fSDavid E. O'Brien.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
269d62501fSDavid E. O'Brien.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
279d62501fSDavid E. O'Brien.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
289d62501fSDavid E. O'Brien.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
299d62501fSDavid E. O'Brien.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
309d62501fSDavid E. O'Brien.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
319d62501fSDavid E. O'Brien.\"
32ec0bd8b0SJohannes Totz.Dd June 10, 2023
339d62501fSDavid E. O'Brien.Dt RCORDER 8
349d62501fSDavid E. O'Brien.Os
359d62501fSDavid E. O'Brien.Sh NAME
369d62501fSDavid E. O'Brien.Nm rcorder
379d62501fSDavid E. O'Brien.Nd print a dependency ordering of interdependent files
389d62501fSDavid E. O'Brien.Sh SYNOPSIS
399d62501fSDavid E. O'Brien.Nm
4030fe2bbfSAndrey V. Elsukov.Op Fl gp
419d62501fSDavid E. O'Brien.Op Fl k Ar keep
429d62501fSDavid E. O'Brien.Op Fl s Ar skip
439d62501fSDavid E. O'Brien.Ar
449d62501fSDavid E. O'Brien.Sh DESCRIPTION
45960368f7SPhilippe CharnierThe
469d62501fSDavid E. O'Brien.Nm
47960368f7SPhilippe Charnierutility is designed to print out a dependency ordering of a set of
4835cf61f6SRuslan Ermilovinterdependent files.
4935cf61f6SRuslan ErmilovTypically it is used to find an execution
509d62501fSDavid E. O'Briensequence for a set of shell scripts in which certain files must be
519d62501fSDavid E. O'Brienexecuted before others.
529d62501fSDavid E. O'Brien.Pp
539d62501fSDavid E. O'BrienEach file passed to
549d62501fSDavid E. O'Brien.Nm
559d62501fSDavid E. O'Brienmust be annotated with special lines (which look like comments to the
569d62501fSDavid E. O'Brienshell) which indicate the dependencies the files have upon certain
579d62501fSDavid E. O'Brienpoints in the sequence, known as
589d62501fSDavid E. O'Brien.Dq conditions ,
599d62501fSDavid E. O'Brienand which indicate, for each file, which
609d62501fSDavid E. O'Brien.Dq conditions
619d62501fSDavid E. O'Brienmay be expected to be filled by that file.
629d62501fSDavid E. O'Brien.Pp
639d62501fSDavid E. O'BrienWithin each file, a block containing a series of
64f5c5d414SMateusz Piotrowski.Ql REQUIRE ,
65f5c5d414SMateusz Piotrowski.Ql PROVIDE ,
66f5c5d414SMateusz Piotrowski.Ql BEFORE
679d62501fSDavid E. O'Brienand
68f5c5d414SMateusz Piotrowski.Ql KEYWORD
699d62501fSDavid E. O'Brienlines must appear.
7035cf61f6SRuslan ErmilovThe format of the lines is rigid.
7135cf61f6SRuslan ErmilovEach line must begin with a single
7235cf61f6SRuslan Ermilov.Ql # ,
739d62501fSDavid E. O'Brienfollowed by a single space, followed by
74f5c5d414SMateusz Piotrowski.Ql PROVIDE\&: ,
75f5c5d414SMateusz Piotrowski.Ql REQUIRE\&: ,
76f5c5d414SMateusz Piotrowski.Ql BEFORE\&: ,
779d62501fSDavid E. O'Brienor
78f5c5d414SMateusz Piotrowski.Ql KEYWORD\&: .
799d62501fSDavid E. O'BrienNo deviation is permitted.
809d62501fSDavid E. O'BrienEach dependency line is then followed by a series of conditions,
8135cf61f6SRuslan Ermilovseparated by whitespace.
8235cf61f6SRuslan ErmilovMultiple
83f5c5d414SMateusz Piotrowski.Ql PROVIDE ,
84f5c5d414SMateusz Piotrowski.Ql REQUIRE ,
85f5c5d414SMateusz Piotrowski.Ql BEFORE
869d62501fSDavid E. O'Brienand
87f5c5d414SMateusz Piotrowski.Ql KEYWORD
889d62501fSDavid E. O'Brienlines may appear, but all such lines must appear in a sequence without
899d62501fSDavid E. O'Brienany intervening lines, as once a line that does not follow the format
909d62501fSDavid E. O'Brienis reached, parsing stops.
917fab6043SDoug Barton.\" Note that for historical reasons REQUIRES, PROVIDES, and KEYWORDS
927fab6043SDoug Barton.\" are also accepted in addition to the above, but not documented so
937fab6043SDoug Barton.\" that they can be deprecated at some point in the future.
949d62501fSDavid E. O'Brien.Pp
959d62501fSDavid E. O'BrienThe options are as follows:
96f5c5d414SMateusz Piotrowski.Bl -tag -width "-k keep"
9730fe2bbfSAndrey V. Elsukov.It Fl g
9830fe2bbfSAndrey V. ElsukovProduce a GraphViz (.dot) of the complete dependency graph instead of
9930fe2bbfSAndrey V. Elsukovplaintext calling order list.
100f5c5d414SMateusz Piotrowski.It Fl k Ar keep
1019d62501fSDavid E. O'BrienAdd the specified keyword to the
10235cf61f6SRuslan Ermilov.Dq "keep list" .
1039d62501fSDavid E. O'BrienIf any
1049d62501fSDavid E. O'Brien.Fl k
1059d62501fSDavid E. O'Brienoption is given, only those files containing the matching keyword are listed.
106f5c5d414SMateusz PiotrowskiThis option can be specified multiple times.
10730fe2bbfSAndrey V. Elsukov.It Fl p
10830fe2bbfSAndrey V. ElsukovGenerate ordering suitable for parallel startup, placing files that can be
10930fe2bbfSAndrey V. Elsukovexecuted simultaneously on the same line.
110f5c5d414SMateusz Piotrowski.It Fl s Ar skip
1119d62501fSDavid E. O'BrienAdd the specified keyword to the
11235cf61f6SRuslan Ermilov.Dq "skip list" .
1139d62501fSDavid E. O'BrienIf any
1149d62501fSDavid E. O'Brien.Fl s
1159d62501fSDavid E. O'Brienoption is given, files containing the matching keyword are not listed.
116f5c5d414SMateusz PiotrowskiThis option can be specified multiple times.
1179d62501fSDavid E. O'Brien.El
1189d62501fSDavid E. O'Brien.Pp
1199d62501fSDavid E. O'BrienAn example block follows:
1209d62501fSDavid E. O'Brien.Bd -literal -offset indent
1219d62501fSDavid E. O'Brien# REQUIRE: networking syslog
1229d62501fSDavid E. O'Brien# REQUIRE: usr
1239d62501fSDavid E. O'Brien# PROVIDE: dns nscd
1249d62501fSDavid E. O'Brien.Ed
1259d62501fSDavid E. O'Brien.Pp
1269d62501fSDavid E. O'BrienThis block states that the file in which it appears depends upon the
127f5c5d414SMateusz Piotrowski.Ql networking ,
128f5c5d414SMateusz Piotrowski.Ql syslog ,
1299d62501fSDavid E. O'Brienand
130f5c5d414SMateusz Piotrowski.Ql usr
1319d62501fSDavid E. O'Brienconditions, and provides the
132f5c5d414SMateusz Piotrowski.Ql dns
1339d62501fSDavid E. O'Brienand
134f5c5d414SMateusz Piotrowski.Ql nscd
1359d62501fSDavid E. O'Brienconditions.
1369d62501fSDavid E. O'Brien.Pp
1379d62501fSDavid E. O'BrienA file may contain zero
138f5c5d414SMateusz Piotrowski.Ql PROVIDE
1399d62501fSDavid E. O'Brienlines, in which case it provides no conditions, and may contain zero
140f5c5d414SMateusz Piotrowski.Ql REQUIRE
1419d62501fSDavid E. O'Brienlines, in which case it has no dependencies.
1429d62501fSDavid E. O'BrienThere must be at least one file with no dependencies in the set of
1439d62501fSDavid E. O'Brienarguments passed to
1449d62501fSDavid E. O'Brien.Nm
1459d62501fSDavid E. O'Brienin order for it to find a starting place in the dependency ordering.
146b25a469fSEugene Grosbein.Sh KEYWORDS
147b25a469fSEugene GrosbeinThere are several
148b25a469fSEugene Grosbein.Em KEYWORDs
149b25a469fSEugene Grosbeinin use:
150f5c5d414SMateusz Piotrowski.Bl -tag -width "shutdown" -offset indent
151f5c5d414SMateusz Piotrowski.It Sy firstboot , nojail , nojailvnet , nostart
152b25a469fSEugene GrosbeinUsed by
153b25a469fSEugene Grosbein.Xr rc 8 .
154ec0bd8b0SJohannes Totz.It Sy suspend , resume
155b25a469fSEugene GrosbeinUsed by
156ec0bd8b0SJohannes Totz.Nm /etc/rc.suspend
157ec0bd8b0SJohannes Totzand
158b25a469fSEugene Grosbein.Nm /etc/rc.resume
159b25a469fSEugene Grosbein(see
160b25a469fSEugene Grosbein.Xr acpiconf 8 )
161f5c5d414SMateusz Piotrowski.It Sy shutdown
162b25a469fSEugene GrosbeinUsed by
163b25a469fSEugene Grosbein.Xr rc.shutdown 8 .
164b25a469fSEugene Grosbein.El
165f5c5d414SMateusz Piotrowski.Sh EXAMPLES
166f5c5d414SMateusz PiotrowskiPrint the dependency ordering of the services from the base system and
167f5c5d414SMateusz Piotrowski.Xr ports 7 :
168f5c5d414SMateusz Piotrowski.Bd -literal -offset indent
169f5c5d414SMateusz Piotrowski$ rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
170f5c5d414SMateusz Piotrowski.Ed
171f5c5d414SMateusz Piotrowski.Pp
172f5c5d414SMateusz PiotrowskiCount the number of services in the base system, which specify the
17347972d6dSJose Luis Duran.Sy nostart
174f5c5d414SMateusz Piotrowskikeyword, while skipping those with
175f5c5d414SMateusz Piotrowski.Sy firstboot
176f5c5d414SMateusz Piotrowskiand
177f5c5d414SMateusz Piotrowski.Sy nojailvnet :
178f5c5d414SMateusz Piotrowski.Bd -literal -offset indent
179f5c5d414SMateusz Piotrowski$ rcorder -k nostart -s firstboot -s nojailvnet /etc/rc.d/*  | wc -l
180f5c5d414SMateusz Piotrowski       3
181f5c5d414SMateusz Piotrowski.Ed
1829d62501fSDavid E. O'Brien.Sh DIAGNOSTICS
183960368f7SPhilippe CharnierThe
1849d62501fSDavid E. O'Brien.Nm
185960368f7SPhilippe Charnierutility may print one of the following error messages and exit with a non-zero
1869d62501fSDavid E. O'Brienstatus if it encounters an error while processing the file list.
1879d62501fSDavid E. O'Brien.Bl -diag
18830fe2bbfSAndrey V. Elsukov.It "Requirement %s in file %s has no providers."
1899d62501fSDavid E. O'BrienNo file has a
190f5c5d414SMateusz Piotrowski.Ql PROVIDE
1919d62501fSDavid E. O'Brienline corresponding to a condition present in a
192f5c5d414SMateusz Piotrowski.Ql REQUIRE
1939d62501fSDavid E. O'Brienline in another file.
19430fe2bbfSAndrey V. Elsukov.It "Circular dependency on provision %s in file %s."
1959d62501fSDavid E. O'BrienA set of files has a circular dependency which was detected while
1969d62501fSDavid E. O'Brienprocessing the stated condition.
19730fe2bbfSAndrey V. ElsukovLoop visualization follows this message.
19830fe2bbfSAndrey V. Elsukov.It "Circular dependency on file %s."
1999d62501fSDavid E. O'BrienA set of files has a circular dependency which was detected while
2009d62501fSDavid E. O'Brienprocessing the stated file.
20130fe2bbfSAndrey V. Elsukov.It "%s was seen in circular dependencies for %d times."
20230fe2bbfSAndrey V. ElsukovEach node that was a part of circular dependency loops reports total number of
20330fe2bbfSAndrey V. Elsukovsuch encounters.
20430fe2bbfSAndrey V. ElsukovStart with files having biggest counter when fighting with broken dependencies.
2059d62501fSDavid E. O'Brien.El
20630fe2bbfSAndrey V. Elsukov.Sh DIAGNOSTICS WITH GRAPHVIZ
20730fe2bbfSAndrey V. ElsukovDirect dependency is drawn with solid line,
20830fe2bbfSAndrey V. Elsukov.Ql BEFORE
20930fe2bbfSAndrey V. Elsukovdependency is drawn as a dashed line.
21030fe2bbfSAndrey V. ElsukovEach node of a graph represents an item from
21130fe2bbfSAndrey V. Elsukov.Ql PROVIDE
21230fe2bbfSAndrey V. Elsukovlines.
21330fe2bbfSAndrey V. ElsukovIn case there are more than one file providing an item, a list of filenames
21430fe2bbfSAndrey V. Elsukovshortened with
21530fe2bbfSAndrey V. Elsukov.Xr basename 3
21630fe2bbfSAndrey V. Elsukovis shown.
21730fe2bbfSAndrey V. ElsukovShortened filenames are also shown in case
21830fe2bbfSAndrey V. Elsukov.Ql PROVIDE
21930fe2bbfSAndrey V. Elsukovitem does not match file name.
22030fe2bbfSAndrey V. Elsukov.Pp
22130fe2bbfSAndrey V. ElsukovEdges and nodes where circular dependencies were detected are drawn bold red.
22230fe2bbfSAndrey V. ElsukovIf a file has an item in
22330fe2bbfSAndrey V. Elsukov.Ql REQUIRE
22430fe2bbfSAndrey V. Elsukovor in
22530fe2bbfSAndrey V. Elsukov.Ql BEFORE
22630fe2bbfSAndrey V. Elsukovthat could not be provided,
227*31f68895SYi-Chen Lithis missing provider and the requirement will be drawn in bold red as well.
2280afc94c1SUlrich Spörlein.Sh SEE ALSO
229b25a469fSEugene Grosbein.Xr acpiconf 8 ,
230b25a469fSEugene Grosbein.Xr rc 8 ,
231f5c5d414SMateusz Piotrowski.Xr rc.shutdown 8 ,
232f5c5d414SMateusz Piotrowski.Xr service 8
2330afc94c1SUlrich Spörlein.Sh HISTORY
2340afc94c1SUlrich SpörleinThe
2350afc94c1SUlrich Spörlein.Nm
236ef0a975fSAllan Judeutility appeared in
2370afc94c1SUlrich Spörlein.Nx 1.5 .
238ef0a975fSAllan Jude.Nm
239ef0a975fSAllan Judeutility first appeared in
240ef0a975fSAllan Jude.Fx 5.0 .
2410afc94c1SUlrich Spörlein.Sh AUTHORS
2420afc94c1SUlrich Spörlein.An -nosplit
2430afc94c1SUlrich SpörleinWritten by
244bd0891ceSBaptiste Daroussin.An Perry E. Metzger Aq Mt perry@piermont.com
2450afc94c1SUlrich Spörleinand
246bd0891ceSBaptiste Daroussin.An Matthew R. Green Aq Mt mrg@eterna.com.au .
247e911e766SMike Makonnen.Sh BUGS
248e911e766SMike MakonnenThe
249f5c5d414SMateusz Piotrowski.Ql REQUIRE
250e911e766SMike Makonnenkeyword is misleading:
251ef0a975fSAllan JudeIt does not describe which daemons have to be running before a script
252e911e766SMike Makonnenwill be started.
253e911e766SMike MakonnenIt describes which scripts must be placed before it in
254e911e766SMike Makonnenthe dependency ordering.
255e911e766SMike MakonnenFor example,
256e911e766SMike Makonnenif your script has a
257f5c5d414SMateusz Piotrowski.Ql REQUIRE
258e911e766SMike Makonnenon
259f5c5d414SMateusz Piotrowski.Ql sshd ,
260e911e766SMike Makonnenit means the script must be placed after the
261f5c5d414SMateusz Piotrowski.Ql sshd
262e911e766SMike Makonnenscript in the dependency ordering,
263e911e766SMike Makonnennot necessarily that it requires
264f5c5d414SMateusz Piotrowski.Nm sshd
265e911e766SMike Makonnento be started or enabled.
266