diff options
author | mtm <mtm@FreeBSD.org> | 2007-05-18 12:04:41 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2007-05-18 12:04:41 +0000 |
commit | 6d5baaa0915889111c959912b06a8315052876c5 (patch) | |
tree | 6358eeee7fccccd9b0299bd803dcf2ec18d52606 /share/man | |
parent | e1996cb9609d2e55a26ee78dddbfce4ba4073b53 (diff) | |
download | FreeBSD-src-6d5baaa0915889111c959912b06a8315052876c5.zip FreeBSD-src-6d5baaa0915889111c959912b06a8315052876c5.tar.gz |
o Implement the stop_boot subroutine [1]. This subroutine can be used by
scripts in rc.d to stop rc(8) from booting into multi-user mode when
a critical or severe error condition is encountered.
o Modify scripts in etc/rc.d that already implemented this functionality
independently.
o Document it.
[1] - This subroutine was implemented in FreeBSD in rc.d/fsck. I moved it
to rc.subr(8). Our version differs slightly in that it takes an
optional argument to stop the boot even if "autoboot" is not set.
Obtained from: NetBSD
MFC after: 2 weeks
Diffstat (limited to 'share/man')
-rw-r--r-- | share/man/man8/rc.8 | 17 | ||||
-rw-r--r-- | share/man/man8/rc.subr.8 | 19 |
2 files changed, 24 insertions, 12 deletions
diff --git a/share/man/man8/rc.8 b/share/man/man8/rc.8 index 4f1f1ce..7d3cfe5 100644 --- a/share/man/man8/rc.8 +++ b/share/man/man8/rc.8 @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 19, 2005 +.Dd May 18, 2007 .Dt RC 8 .Os .Sh NAME @@ -249,16 +249,11 @@ Extreme care must be taken in using this, as the startup sequence will terminate if the script does. .It Pa bar Scripts that are sourced in a subshell. -These can stop the boot if necessary with the following shell -commands: -.Bd -literal -offset indent -if [ "$autoboot" = yes ]; then - kill -TERM $$ -fi -exit 1 -.Ed -.Pp -Note that this should be used extremely sparingly! +The boot does not stop if such a script terminates with a non-zero status, +but a script can stop the boot if necessary by invoking the +.Fn stop_boot +function (from +.Xr rc.subr 8 ). .El .Pp Each script should contain diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8 index abebb76..682acd9 100644 --- a/share/man/man8/rc.subr.8 +++ b/share/man/man8/rc.subr.8 @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2006 +.Dd May 18, 2007 .Dt RC.SUBR 8 .Os .Sh NAME @@ -833,6 +833,23 @@ otherwise source .Ar file into the current shell. .El +.It Ic stop_boot Op Ar always +Prevent booting to multiuser mode. +If the +.Sy autoboot +variable is +.Sq yes , +or +.Ar always +is +.Sq true , +then a +.Sy SIGTERM +signal is sent to the parent +process (which is assumed to be +.Xr rc 8 ). +Otherwise, the shell exits with status +.Li 1 . .It Ic set_rcvar Op Ar base Set the variable name required to start a service. In |