rcorder

From NetBSD Wiki

Jump to: navigation, search

The rcorder(8) command is used by the system to determine the order in which to run commands from rc.d. You can also call it manually in order to determine in which order to start daemons if you run them after system startup.

The order is determined by looking at the arguments to rcorder (which are supposed to be shell scripts which run daemons). The files are searched for REQUIRE, PROVIDE, BEFORE or KEYWORD lines. These lines look just like regular comments:

# REQUIRE: mountall

This says the command can be run at any time after the "mountall" daemon has been started. rcorder will try to order the files you provide as arguments in such a way that all REQUIREs are after the matching PROVIDEs. If a daemon PROVIDES a certain service, the ones who REQUIRE it must come after it. It's obvious that there has to be at least one script with no REQUIRE part, otherwise there's no way to find a starting point. You can specify that some script must come before another by adding a BEFORE line to it.

Keywords

The rcorder(8) command also has a -k and -s flag, which specify a "keep list" or a "skip list".

If you add anything to the skip list using -s, any script that has a KEYWORD line which names a keyword on the skip list, it is not considered in the ordering process, and consequently not listed in the output.

If you add anything to the "keep list" with -k, it only lists scripts that have a KEYWORD which is in the "keep list".

System startup

At actual system startup, rc calls rcorder(8) with as arguments all files in /etc/rc.d to determine in what order to set the different daemons running, then calls all of these scripts with the 'start' argument. Whether they are actually run or not depends on the settings in rc.conf. At shutdown, rc.shutdown calls rcorder(8) again, but this time it uses a "keep list" of those scripts with the KEYWORD "shutdown", and then runs them in reverse order.

See also

Personal tools