RCORDER(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… RCORDER(8) β€” the rcorder girlies' guide

ok so bestie, welcome to rcorder from section 8 of the system manager's manual β€” she's the one who prints a dependency ordering of interdependent files, and honestly? she ate. πŸŽ€


✨ NAME ✨

rcorder β€” print a dependency ordering of interdependent files πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

rcorder [-gp] [-k keep] [-s skip] file ...

🌸 DESCRIPTION 🌸

okay so the rcorder utility is literally designed to print out a dependency ordering of a set of interdependent files. typically it's used to find an execution sequence for a set of shell scripts where certain files must be executed before others. it's giving backstage-pass energy, no cap. πŸ”₯

each file you pass to rcorder must be annotated with special lines β€” and yes, they look like comments to the shell, that's the whole vibe πŸ™ˆ β€” which indicate the dependencies the files have upon certain points in the sequence, known as "conditions", and which indicate, for each file, which "conditions" may be expected to be filled by that file.

within each file, a block containing a series of REQUIRE, PROVIDE, BEFORE and KEYWORD lines must appear. the format of these lines is rigid, bestie β€” like, no room for interpretation:

  • each line must begin with a single #
  • followed by a single space
  • followed by PROVIDE:, REQUIRE:, BEFORE:, or KEYWORD:

no deviation is permitted. periodt. πŸ’…

each dependency line is then followed by a series of conditions, separated by whitespace. multiple PROVIDE, REQUIRE, BEFORE and KEYWORD lines may appear, but all such lines must appear in a sequence with no intervening lines β€” because once a line that doesn't follow the format is reached, parsing stops. like, that's it, we're done here, the party's over. πŸ’€

the options are as follows:

πŸ‘‘ OPTIONS πŸ‘‘

  • -g β€” produce a GraphViz (.dot) of the complete dependency graph instead of a plaintext calling order list. aesthetic AND functional, we love to see it. πŸ¦‹
  • -k keep β€” add the specified keyword to the "keep list". if any -k option is given, only those files containing the matching keyword are listed. this option can be specified multiple times. 🫢
  • -p β€” generate ordering suitable for parallel startup, placing files that can be executed simultaneously on the same line. multitasking queen behavior. ✨
  • -s skip β€” add the specified keyword to the "skip list". if any -s option is given, files containing the matching keyword are not listed. this option can be specified multiple times. πŸ™…β€β™€οΈ

an example block follows:

# REQUIRE: networking syslog
# REQUIRE: usr
# PROVIDE: dns nscd

this block states that the file in which it appears depends upon the networking, syslog, and usr conditions, and provides the dns and nscd conditions. iconic, honestly.

a file may contain zero PROVIDE lines, in which case it provides no conditions, and may contain zero REQUIRE lines, in which case it has no dependencies. but heads up bestie ⚠️ β€” there must be at least one file with no dependencies in the set of arguments passed to rcorder in order for it to find a starting place in the dependency ordering. someone's gotta go first, yk?

πŸŽ€ KEYWORDS πŸŽ€

there are several KEYWORDs in use:

  • firstboot, nojail, nojailvnet, nostart β€” used by rc(8).
  • suspend, resume β€” used by /etc/rc.suspend and /etc/rc.resume (see acpiconf(8)).
  • shutdown β€” used by rc.shutdown(8).

🌈 EXAMPLES 🌈

print the dependency ordering of the services from the base system and ports(7):

$ rcorder /etc/rc.d/* /usr/local/etc/rc.d/*

count the number of services in the base system which specify the nostart keyword, while skipping those with firstboot and nojailvnet:

$ rcorder -k nostart -s firstboot -s nojailvnet /etc/rc.d/*  | wc -l
       3

math girlies rise up 🧚

πŸ“ DIAGNOSTICS πŸ“

the rcorder utility may print one of the following error messages and exit with a non-zero status if it encounters an error while processing the file list. 😭

  • Requirement %s in file %s has no providers. β€” no file has a PROVIDE line corresponding to a condition present in a REQUIRE line in another file. somebody's missing their other half, tragic.
  • Circular dependency on provision %s in file %s. β€” a set of files has a circular dependency which was detected while processing the stated condition. loop visualization follows this message.
  • Circular dependency on file %s. β€” a set of files has a circular dependency which was detected while processing the stated file.
  • %s was seen in circular dependencies for %d times. β€” each node that was a part of circular dependency loops reports total number of such encounters. start with files having the biggest counter when fighting with broken dependencies. like, biggest red flag first, basically. 🚩

πŸ’œ DIAGNOSTICS WITH GRAPHVIZ πŸ’œ

direct dependency is drawn with a solid line, BEFORE dependency is drawn as a dashed line. each node of a graph represents an item from PROVIDE lines. in case there are more than one file providing an item, a list of filenames shortened with basename(3) is shown. shortened filenames are also shown in case a PROVIDE item does not match the file name.

edges and nodes where circular dependencies were detected are drawn bold red. if a file has an item in REQUIRE or in BEFORE that could not be provided, this missing provider and the requirement will be drawn in bold red as well. red = drama = detected problems, slay. πŸ”₯

⭐ SEE ALSO ⭐

acpiconf(8), rc(8), rc.shutdown(8), service(8)

πŸ¦‹ HISTORY πŸ¦‹

the rcorder utility appeared in NetBSD 1.5. the rcorder utility first appeared in FreeBSD 5.0. she's been serving looks since the early 2000s, we stan a legacy icon. πŸ‘‘

πŸ’– AUTHORS πŸ’–

written by Perry E. Metzger <perry@piermont.com> and Matthew R. Green <mrg@eterna.com.au>. absolute legends, fr fr. 🌸

πŸ’€ BUGS πŸ’€

the REQUIRE keyword is misleading: it does not describe which daemons have to be running before a script will be started. it describes which scripts must be placed before it in the dependency ordering.

for example, if your script has a REQUIRE on sshd, it means the script must be placed after the sshd script in the dependency ordering β€” not necessarily that it requires sshd to be started or enabled. so like, don't come for her, she's just about ordering babes. πŸ™ˆ


ok that's the whole page bestie, go forth and order some dependencies πŸ’…βœ¨

this cutie is from the Debian manual, dated June 10, 2023, and she lives at RCORDER(8) in the System Manager's Manual. mwah. πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms