From nobody Sun Nov 21 20:05:25 2021 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 764B0188A7F3 for ; Sun, 21 Nov 2021 20:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hy1bp2c0pz4qvX; Sun, 21 Nov 2021 20:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19987157B0; Sun, 21 Nov 2021 20:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ALK5P98022014; Sun, 21 Nov 2021 20:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ALK5PNc022013; Sun, 21 Nov 2021 20:05:25 GMT (envelope-from git) Date: Sun, 21 Nov 2021 20:05:25 GMT Message-Id: <202111212005.1ALK5PNc022013@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: 120050663b - main - Add missing paragraph in rc-scripting article List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 120050663b8dee82c7c2f6d7246392ff0d94ac24 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=120050663b8dee82c7c2f6d7246392ff0d94ac24 commit 120050663b8dee82c7c2f6d7246392ff0d94ac24 Author: Rocky Hotas AuthorDate: 2021-11-21 20:04:38 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2021-11-21 20:04:38 +0000 Add missing paragraph in rc-scripting article PR: 259832 Approved by: carlavilla@ --- .../content/en/articles/rc-scripting/_index.adoc | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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]]➎ 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.