1.\" $NetBSD: chkconfig.8,v 1.4 2001/11/16 11:26:54 wiz Exp $ 2.\" 3.\" Copyright (c) 2001 Zembu Labs, Inc. 4.\" All rights reserved. 5.\" 6.\" Author: Dan Mercer <dmercer@zembu.com> 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. All advertising materials mentioning features or use of this software 17.\" must display the following acknowledgement: 18.\" This product includes software developed by Zembu Labs, Inc. 19.\" 4. Neither the name of Zembu Labs nor the names of its employees may 20.\" be used to endorse or promote products derived from this software 21.\" without specific prior written permission. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS 24.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- 25.\" RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- 26.\" CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, 27.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33.\" 34.Dd March 13, 2001 35.Dt CHKCONFIG 8 36.Os 37.Sh NAME 38.Nm chkconfig 39.Nd rc.conf.d management utility 40.Sh SYNOPSIS 41.Nm 42.Op Ar service 43.Nm "" 44.Op Fl f 45.Ar service 46.Op Ar on | off 47.Sh DESCRIPTION 48The 49.Nm 50utility allows a system administrator to easily manage services 51started by 52.Xr rc 8 . 53.Pp 54With no arguments, 55.Nm 56will print the state (on or off) of every service found in the 57directory 58.Pa /etc/rc.conf.d/ . 59The settings will be shown sorted according to the output of 60.Xr rcorder 8 . 61.Pp 62If the 63.Ar service 64is specified as the sole argument, 65.Nm 66exits with status 0 if the service is 67.Sq on 68and status 1 if 69.Sq off . 70The exit status may be used by shell scripts to test the state of 71a service, for example: 72.Bd -literal -offset indent 73if chkconfig wscons; then 74 echo "wscons is on" 75else 76 echo "wscons is off" 77fi 78.Ed 79.Pp 80The optional third argument allows the specified service to be set 81to 82.Sq on 83or 84.Sq off 85for the next time its 86.Xr rc.d 8 87script is run (generally the next system reboot). 88.Pp 89In order for 90.Nm 91to display service status or to control service state, the service 92must be managed by 93.Nm "" . 94A 95.Nm 96managed service is one that has the 97.Xr rcorder 8 98keyword 99.Dq chkconfig 100present in the 101.Xr rc.d 8 102script for that service. If a service's script does not contain 103this keyword, it may still be managed by 104.Nm 105using the 106.Fl f 107flag. When this flag is used, 108.Nm 109will automatically add the 110.Dq chkconfig 111keyword to the service's script. 112.Sh SEE ALSO 113.Xr rc 8 , 114.Xr rcorder 8 115.Sh HISTORY 116The 117.Nm 118command first appeared in 119.Nx 1.6 . 120.Sh AUTHORS 121The 122.Nm 123program was written by 124.An Dan Mercer 125.Aq dmercer@zembu.com 126of Zembu Labs, Inc. 127.Sh BUGS 128The 129.Nm 130program currently does not support configuring the options 131to be passed to services upon startup. 132