aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRocky Hotas <rockyhotas@post.com>2021-11-21 20:04:38 +0000
committerSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-11-21 20:04:38 +0000
commit120050663b8dee82c7c2f6d7246392ff0d94ac24 (patch)
tree780e7caec21d04913bb15d16266843578bc9045f
parentc0a1c8e9223b13a174895fc60840f7490728ec1c (diff)
downloaddoc-120050663b8dee82c7c2f6d7246392ff0d94ac24.tar.gz
doc-120050663b8dee82c7c2f6d7246392ff0d94ac24.zip
Add missing paragraph in rc-scripting article
PR: 259832 Approved by: carlavilla@
-rw-r--r--documentation/content/en/articles/rc-scripting/_index.adoc23
1 files changed, 23 insertions, 0 deletions
diff --git a/documentation/content/en/articles/rc-scripting/_index.adoc b/documentation/content/en/articles/rc-scripting/_index.adoc
index 750072951e..bc939aec04 100644
--- a/documentation/content/en/articles/rc-scripting/_index.adoc
+++ b/documentation/content/en/articles/rc-scripting/_index.adoc
@@ -685,6 +685,29 @@ From all the files to be dependency sorted, man:rcorder[8] will pick only those
In FreeBSD, man:rcorder[8] is used by [.filename]#/etc/rc# and [.filename]#/etc/rc.shutdown#.
These two scripts define the standard list of FreeBSD [.filename]#rc.d# keywords and their meanings as follows:
+nojail:: The service is not for man:jail[8] environment.
+The automatic startup and shutdown procedures will ignore the script if inside a jail.
+
+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.
+
+shutdown:: This keyword is to be listed __explicitly__ if the service needs to be stopped before system shutdown.
+
+[NOTE]
+====
+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.
+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.
+====
+
[[forcedep]]&#10126; To begin with, `force_depend` should be used with much care.
It is generally better to revise the hierarchy of configuration variables for your [.filename]#rc.d# scripts if they are interdependent.