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 October 27, 2018 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 46The 47.Nm 48utility is designed to print out a dependency ordering of a set of 49interdependent files. 50Typically it is used to find an execution 51sequence for a set of shell scripts in which certain files must be 52executed before others. 53.Pp 54Each file passed to 55.Nm 56must be annotated with special lines (which look like comments to the 57shell) which indicate the dependencies the files have upon certain 58points in the sequence, known as 59.Dq conditions , 60and which indicate, for each file, which 61.Dq conditions 62may be expected to be filled by that file. 63.Pp 64Within each file, a block containing a series of 65.Dq Li REQUIRE , 66.Dq Li PROVIDE , 67.Dq Li BEFORE 68and 69.Dq Li KEYWORD 70lines must appear. 71The format of the lines is rigid. 72Each line must begin with a single 73.Ql # , 74followed by a single space, followed by 75.Dq Li PROVIDE: , 76.Dq Li REQUIRE: , 77.Dq Li BEFORE: , 78or 79.Dq Li KEYWORD: . 80No deviation is permitted. 81Each dependency line is then followed by a series of conditions, 82separated by whitespace. 83Multiple 84.Dq Li PROVIDE , 85.Dq Li REQUIRE , 86.Dq Li BEFORE 87and 88.Dq Li KEYWORD 89lines may appear, but all such lines must appear in a sequence without 90any intervening lines, as once a line that does not follow the format 91is 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 96The options are as follows: 97.Bl -tag -width indent 98.It Fl k 99Add the specified keyword to the 100.Dq "keep list" . 101If any 102.Fl k 103option is given, only those files containing the matching keyword are listed. 104.It Fl s 105Add the specified keyword to the 106.Dq "skip list" . 107If any 108.Fl s 109option is given, files containing the matching keyword are not listed. 110.El 111.Pp 112An example block follows: 113.Bd -literal -offset indent 114# REQUIRE: networking syslog 115# REQUIRE: usr 116# PROVIDE: dns nscd 117.Ed 118.Pp 119This block states that the file in which it appears depends upon the 120.Dq Li networking , 121.Dq Li syslog , 122and 123.Dq Li usr 124conditions, and provides the 125.Dq Li dns 126and 127.Dq Li nscd 128conditions. 129.Pp 130A file may contain zero 131.Dq Li PROVIDE 132lines, in which case it provides no conditions, and may contain zero 133.Dq Li REQUIRE 134lines, in which case it has no dependencies. 135There must be at least one file with no dependencies in the set of 136arguments passed to 137.Nm 138in order for it to find a starting place in the dependency ordering. 139.Sh KEYWORDS 140There are several 141.Em KEYWORDs 142in use: 143.Bl -tag -width ".Cm shutdown" -offset indent 144.It Cm firstboot, nojail, nojailvnet, nostart 145Used by 146.Xr rc 8 . 147.It Cm resume 148Used by 149.Nm /etc/rc.resume 150(see 151.Xr acpiconf 8 ) 152.It Cm shutdown 153Used by 154.Xr rc.shutdown 8 . 155.El 156.Sh DIAGNOSTICS 157The 158.Nm 159utility may print one of the following error messages and exit with a non-zero 160status if it encounters an error while processing the file list. 161.Bl -diag 162.It "Requirement %s has no providers, aborting." 163No file has a 164.Dq Li PROVIDE 165line corresponding to a condition present in a 166.Dq Li REQUIRE 167line in another file. 168.It "Circular dependency on provision %s, aborting." 169A set of files has a circular dependency which was detected while 170processing the stated condition. 171.It "Circular dependency on file %s, aborting." 172A set of files has a circular dependency which was detected while 173processing the stated file. 174.El 175.Sh SEE ALSO 176.Xr acpiconf 8 , 177.Xr rc 8 , 178.Xr rc.shutdown 8 179.Sh HISTORY 180The 181.Nm 182utility appeared in 183.Nx 1.5 . 184.Nm 185utility first appeared in 186.Fx 5.0 . 187.Sh AUTHORS 188.An -nosplit 189Written by 190.An Perry E. Metzger Aq Mt perry@piermont.com 191and 192.An Matthew R. Green Aq Mt mrg@eterna.com.au . 193.Sh BUGS 194The 195.Dq Li REQUIRE 196keyword is misleading: 197It does not describe which daemons have to be running before a script 198will be started. 199It describes which scripts must be placed before it in 200the dependency ordering. 201For example, 202if your script has a 203.Dq Li REQUIRE 204on 205.Dq Li named , 206it means the script must be placed after the 207.Dq Li named 208script in the dependency ordering, 209not necessarily that it requires 210.Xr named 8 211to be started or enabled. 212