minor improvements, including consistency in how variables are formatted.

This commit is contained in:
lukem 2002-04-18 11:14:33 +00:00
parent 2f01f87528
commit 0e798bbe1e
2 changed files with 62 additions and 44 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: rc.8,v 1.23 2002/03/22 04:32:10 lukem Exp $
.\" $NetBSD: rc.8,v 1.24 2002/04/18 11:14:33 lukem Exp $
.\"
.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 22, 2002
.Dd April 18, 2002
.Dt RC 8
.Os
.Sh NAME
@ -75,7 +75,7 @@ at startup,
.Nm rc.shutdown
at shutdown,
and as necessary during system operation to stop, start, restart, reload,
(etc) the service.
or otherwise control the service.
.Ss Operation of rc
.Bl -enum
.It
@ -86,14 +86,16 @@ to load various
shell functions to use.
.It
If autobooting, set
.Dv $autoboot
to
.Sq yes ,
and enable a flag which prevents the
.Sy autoboot=yes
and enable a flag
.Sy ( rc_fast=yes ) ,
which prevents the
.Nm rc.d
scripts from performing the check for already running processes
(thus speeding up the boot process).
This speedup won't occur when
This
.Sy rc_fast=yes
speedup won't occur when
.Nm
is started up after exiting the single-user shell.
.It
@ -158,20 +160,20 @@ is located in
.Pa /etc/rc.d .
The following file naming conventions are currently used in
.Nm rc.d/ :
.Bl -tag -width ALLUPPERCASE -offset indent
.It ALLUPPERCASE
.Bl -tag -width ALLUPPERCASExx -offset indent
.It Pa ALLUPPERCASE
Scripts that are
.Sq placeholders
to ensure that certain operations are done before others.
to ensure that certain operations are performed before others.
In order of startup, these are:
.Bl -tag -width NETWORKING
.It NETWORKING
.Bl -tag -width NETWORKINGxx
.It Pa NETWORKING
Ensure basic network services are running, including general
network configuration
.Pq Pa network
and
.Pa dhclient .
.It SERVERS
.It Pa SERVERS
Ensure basic services (such as
.Pa NETWORKING ,
.Pa ppp ,
@ -183,13 +185,13 @@ exist for services that start early (such as
because they're required by
.Pa DAEMON
below.
.It DAEMON
.It Pa DAEMON
Before all general purpose daemons such as
.Pa dhcpd ,
.Pa lpd ,
and
.Pa ntpd .
.It LOGIN
.It Pa LOGIN
Before user login services
.Pa ( inetd ,
.Pa telnetd ,
@ -203,8 +205,11 @@ as well as before services which might run commands as users
and
.Pa sendmail ) .
.El
.It foo.sh
Scripts that are to be sourced into the current shell rather than a subshell.
.It Pa foo.sh
Scripts that are to be sourced into the current shell rather than a subshell
have a
.Sq Pa .sh
suffix.
Extreme care must be taken in using this, as the startup sequence will
terminate if the script does.
.Pa /etc/rc.d/bootconf.sh
@ -212,7 +217,7 @@ uses this behaviour to allow the user to select a different
configuration (including
.Pa /etc/rc.conf )
early in the boot.
.It bar
.It Pa bar
Scripts that are sourced in a subshell.
These can stop the boot if necessary with the following shell
commands:
@ -223,12 +228,18 @@ commands:
exit 1
.Ed
.Pp
Note that this should be used sparingly!
Note that this should be used extremely sparingly!
.El
.Pp
Each script should contain
.Xr rcorder 8
keywords, especially an appropriate
.Dq PROVIDE
entry.
.Pp
The scripts are expected to support at least the following arguments:
.Bl -tag -width restart -offset indent
.It start
.It Sy start
Start the service.
This should check that the service is to be started as specified by
.Xr rc.conf 5 .
@ -243,7 +254,7 @@ If
is given, ignore the
.Xr rc.conf 5
check and start anyway.
.It stop
.It Sy stop
If the service is to be started as specified by
.Xr rc.conf 5 ,
stop the service.
@ -253,14 +264,21 @@ If
is given, ignore the
.Xr rc.conf 5
check and attempt to stop.
.It restart
Effectively perform a stop then a start.
.It status
.It Sy restart
Perform a
.Sy stop
then a
.Sy start .
.It Sy status
If the script starts a process (rather than performing a one-off
operation), show the status of the process.
Otherwise it's not necessary to support this argument.
Defaults to displaying the process ID of the program (if running).
.It rcvar
.It Sy poll
If the script starts a process (rather than performing a one-off
operation), wait for the command to exit.
Otherwise it's not necessary to support this argument.
.It Sy rcvar
Display which
.Xr rc.conf 5
variables are used to control the startup of the service (if any).

View File

@ -1,4 +1,4 @@
.\" $NetBSD: rc.subr.8,v 1.7 2002/03/27 08:53:43 lukem Exp $
.\" $NetBSD: rc.subr.8,v 1.8 2002/04/18 11:14:33 lukem Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 27, 2002
.Dd April 18, 2002
.Dt RC.SUBR 8
.Os
.Sh NAME
@ -213,7 +213,7 @@ with an exit value of
.Ar exitval .
The error message consists of the script name
(from
.Va $0 ) ,
.Sy $0 ) ,
followed by
.Dq ": ERROR: " ,
and then
@ -243,7 +243,7 @@ mounting each one that
is not currently mounted.
.It Ic rc_usage Ar command Op Ar ...
Print a usage message for
.Va $0 ,
.Sy $0 ,
with
.Ar commands
being the list of valid arguments
@ -554,19 +554,19 @@ Various shell variables are unset before
.Ar file
is started:
.Bd -ragged -offset indent
.Li name ,
.Li command ,
.Li command_args ,
.Li command_interpreter ,
.Li extra_commands ,
.Li pidfile ,
.Li rcvar ,
.Li required_dirs ,
.Li required_files ,
.Li required_vars ,
.Li Ar argument Ns _cmd ,
.Li Ar argument Ns _precmd .
.Li Ar argument Ns _postcmd .
.Sy name ,
.Sy command ,
.Sy command_args ,
.Sy command_interpreter ,
.Sy extra_commands ,
.Sy pidfile ,
.Sy rcvar ,
.Sy required_dirs ,
.Sy required_files ,
.Sy required_vars ,
.Ar argument Ns Sy _cmd ,
.Ar argument Ns Sy _precmd .
.Ar argument Ns Sy _postcmd .
.Ed
.Pp
The startup behaviour of
@ -621,7 +621,7 @@ using
.Xr logger 1 .
The warning message consists of the script name
(from
.Va $0 ) ,
.Sy $0 ) ,
followed by
.Dq ": WARNING: " ,
and then