2003-02-25 13:34:36 +03:00
|
|
|
.\" $NetBSD: chkconfig.8,v 1.6 2003/02/25 10:34:53 wiz Exp $
|
2001-03-14 06:51:46 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2001 Zembu Labs, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Author: Dan Mercer <dmercer@zembu.com>
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by Zembu Labs, Inc.
|
|
|
|
.\" 4. Neither the name of Zembu Labs nor the names of its employees may
|
|
|
|
.\" be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS
|
|
|
|
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR-
|
|
|
|
.\" RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS-
|
|
|
|
.\" CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.Dd March 13, 2001
|
|
|
|
.Dt CHKCONFIG 8
|
2001-06-05 15:22:41 +04:00
|
|
|
.Os
|
2001-03-14 06:51:46 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm chkconfig
|
|
|
|
.Nd rc.conf.d management utility
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Ar service
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
2001-03-14 06:51:46 +03:00
|
|
|
.Op Fl f
|
|
|
|
.Ar service
|
|
|
|
.Op Ar on | off
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility allows a system administrator to easily manage services
|
|
|
|
started by
|
|
|
|
.Xr rc 8 .
|
|
|
|
.Pp
|
|
|
|
With no arguments,
|
|
|
|
.Nm
|
|
|
|
will print the state (on or off) of every service found in the
|
|
|
|
directory
|
|
|
|
.Pa /etc/rc.conf.d/ .
|
|
|
|
The settings will be shown sorted according to the output of
|
|
|
|
.Xr rcorder 8 .
|
|
|
|
.Pp
|
|
|
|
If the
|
|
|
|
.Ar service
|
|
|
|
is specified as the sole argument,
|
|
|
|
.Nm
|
|
|
|
exits with status 0 if the service is
|
|
|
|
.Sq on
|
|
|
|
and status 1 if
|
|
|
|
.Sq off .
|
|
|
|
The exit status may be used by shell scripts to test the state of
|
|
|
|
a service, for example:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
if chkconfig wscons; then
|
|
|
|
echo "wscons is on"
|
|
|
|
else
|
|
|
|
echo "wscons is off"
|
|
|
|
fi
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The optional third argument allows the specified service to be set
|
|
|
|
to
|
|
|
|
.Sq on
|
|
|
|
or
|
|
|
|
.Sq off
|
|
|
|
for the next time its
|
|
|
|
.Xr rc.d 8
|
|
|
|
script is run (generally the next system reboot).
|
|
|
|
.Pp
|
|
|
|
In order for
|
|
|
|
.Nm
|
|
|
|
to display service status or to control service state, the service
|
|
|
|
must be managed by
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm .
|
2001-03-14 06:51:46 +03:00
|
|
|
A
|
|
|
|
.Nm
|
|
|
|
managed service is one that has the
|
|
|
|
.Xr rcorder 8
|
|
|
|
keyword
|
|
|
|
.Dq chkconfig
|
|
|
|
present in the
|
2001-04-03 15:19:54 +04:00
|
|
|
.Xr rc.d 8
|
2002-10-01 17:40:23 +04:00
|
|
|
script for that service.
|
|
|
|
If a service's script does not contain
|
2001-03-14 06:51:46 +03:00
|
|
|
this keyword, it may still be managed by
|
|
|
|
.Nm
|
|
|
|
using the
|
|
|
|
.Fl f
|
2002-10-01 17:40:23 +04:00
|
|
|
flag.
|
|
|
|
When this flag is used,
|
2001-03-14 06:51:46 +03:00
|
|
|
.Nm
|
|
|
|
will automatically add the
|
|
|
|
.Dq chkconfig
|
|
|
|
keyword to the service's script.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr rc 8 ,
|
|
|
|
.Xr rcorder 8
|
2001-11-16 14:26:53 +03:00
|
|
|
.Sh HISTORY
|
2001-03-14 06:51:46 +03:00
|
|
|
The
|
|
|
|
.Nm
|
2001-11-16 14:26:53 +03:00
|
|
|
command first appeared in
|
|
|
|
.Nx 1.6 .
|
|
|
|
.Sh AUTHORS
|
2001-03-14 06:51:46 +03:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
program was written by
|
|
|
|
.An Dan Mercer
|
|
|
|
.Aq dmercer@zembu.com
|
|
|
|
of Zembu Labs, Inc.
|
2001-11-16 14:26:53 +03:00
|
|
|
.Sh BUGS
|
2001-03-14 06:51:46 +03:00
|
|
|
The
|
|
|
|
.Nm
|
2001-11-16 14:26:53 +03:00
|
|
|
program currently does not support configuring the options
|
|
|
|
to be passed to services upon startup.
|