View | Details | Raw Unified | Return to bug 259832
Collapse All | Expand All

(-)b/documentation/content/en/articles/rc-scripting/_index.adoc (+11 lines)
Lines 685-690 From all the files to be dependency sorted, man:rcorder[8] will pick only those Link Here
685
In FreeBSD, man:rcorder[8] is used by [.filename]#/etc/rc# and [.filename]#/etc/rc.shutdown#.
685
In FreeBSD, man:rcorder[8] is used by [.filename]#/etc/rc# and [.filename]#/etc/rc.shutdown#.
686
These two scripts define the standard list of FreeBSD [.filename]#rc.d# keywords and their meanings as follows:
686
These two scripts define the standard list of FreeBSD [.filename]#rc.d# keywords and their meanings as follows:
687
687
688
nojail:: The service is not for man:jail[8] environment. The automatic startup and shutdown procedures will ignore the script if inside a jail.
689
nostart:: The service is to be started manually or not started at all. The automatic startup procedure will ignore the script. In conjunction with the [.filename]#shutdown# keyword, this can be used to write scripts that do something only at system shutdown.
690
shutdown:: This keyword is to be listed __explicitly__ if the service needs to be stopped before system shutdown.
691
692
[NOTE]
693
====
694
When the system is going to shut down, [.filename]#/etc/rc.shutdown# runs. It assumes that most [.filename]#rc.d# scripts have nothing to do at that time. Therefore [.filename]#/etc/rc.shutdown# selectively invokes [.filename]#rc.d# scripts with the [.filename]#shutdown# keyword, effectively ignoring the rest of the scripts. For even faster shutdown, [.filename]#/etc/rc.shutdown# passes the [.filename]#faststop# command to the scripts it runs so that they skip preliminary checks, e.g., the pidfile check. As dependent services should be stopped before their prerequisites, [.filename]#/etc/rc.shutdown# runs the scripts in reverse dependency order.
695
696
If writing a real [.filename]#rc.d# script, you should consider whether it is relevant at system shutdown time. E.g., if your script does its work in response to the [.filename]#start# command only, then you need not to include this keyword. However, if your script manages a service, it is probably a good idea to stop it before the system proceeds to the final stage of its shutdown sequence described in man:halt[8]. In particular, a service should be stopped explicitly if it needs considerable time or special actions to shut down cleanly. A typical example of such a service is a database engine.
697
====
698
688
[[forcedep]]➎ To begin with, `force_depend` should be used with much care.
699
[[forcedep]]➎ To begin with, `force_depend` should be used with much care.
689
It is generally better to revise the hierarchy of configuration variables for your [.filename]#rc.d# scripts if they are interdependent.
700
It is generally better to revise the hierarchy of configuration variables for your [.filename]#rc.d# scripts if they are interdependent.
690
701

Return to bug 259832