1.\" $OpenBSD: rc.conf.8,v 1.31 2022/09/25 22:47:27 kn Exp $ 2.\" 3.\" Copyright (c) 1997 Ian F. Darwin 4.\" Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. The name of the author may not be used to endorse or promote 16.\" products derived from this software without specific prior written 17.\" permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 20.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 23.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.Dd $Mdocdate: September 25 2022 $ 32.Dt RC.CONF 8 33.Os 34.Sh NAME 35.Nm rc.conf , 36.Nm rc.conf.local 37.Nd system daemon configuration database 38.Sh DESCRIPTION 39The file 40.Nm rc.conf 41contains a series of variable assignments that are used to configure 42the system daemons. 43These variables are read by 44.Xr rc 8 45early on in the boot sequence and every time an 46.Xr rc.d 8 47script is executed. 48.Pp 49It is advisable to leave 50.Nm rc.conf 51untouched, and instead create and edit a new 52.Nm rc.conf.local 53file or use the 54.Xr rcctl 8 55utility. 56Since only the last assignment to any variable takes effect, 57variables set in this file override variables previously set in 58.Nm rc.conf . 59.Pp 60.Nm rc.conf 61is made up of variable assignments 62.Pq Ar variable Ns = Ns Ar value 63with comments designated by a hash mark 64.Pq Sq # . 65.Pp 66.Sy Base system daemon 67configuration variables are used to enable and disable daemon programs 68that are installed by default, and to set their command line options. 69.Pp 70All of these variables follow the format 71.Dq Ar daemon Ns _flags 72where 73.Ar daemon 74is the name of one of the 75.Xr rc.d 8 76daemon control scripts. 77The list of base system daemons, including the information whether 78they are enabled by default, can be displayed with this command: 79.Pp 80.Dl grep _flags /etc/rc.conf 81.Pp 82If one of these variables is set to 83.Cm NO , 84the respective 85.Ar daemon 86is disabled. 87If set to the empty string, the 88.Ar daemon 89is run with the default command line arguments defined in its 90.Xr rc.d 8 91.Ar daemon 92script, or without command line arguments if no such default exists. 93If set to any other value, including a string containing 94only a single blank character, the 95.Ar daemon 96is run with those command line arguments. 97.Pp 98.Sy Package daemon 99configuration variables are used to enable and disable 100daemon programs installed from 101.Xr packages 7 , 102and to set their command line options. 103.Pp 104The special 105.Cm pkg_scripts 106variable lists 107.Xr rc.d 8 108.Ar daemon 109control scripts to be started in the specified order. 110For each 111.Ar daemon 112listed, its default command line options can optionally be overridden 113using the variable 114.Ar daemon Ns _flags 115as described above. 116.Pp 117.Sy Base system service 118configuration variables control features available by default 119that are not implemented as daemons. 120They can be set to either 121.Cm YES 122or 123.Cm NO . 124When set to 125.Cm YES , 126they have the following effects: 127.Bl -tag -width check_quotas 128.It Cm accounting 129rc calls: 130.Xr accton 8 131.Pa /var/account/acct 132.It Cm check_quotas 133rc calls: 134.Xr quotacheck 8 135.Fl a ; 136.Xr quotaon 8 137.Fl a 138.It Cm ipsec 139rc calls: 140.Xr ipsecctl 8 141.Fl f Pa /etc/ipsec.conf 142.It Cm library_aslr 143rc reorders some libraries for improved protection against ROP. 144.It Cm multicast 145See 146.Xr multicast 4 . 147.It Cm pf 148rc calls: 149.Xr pfctl 8 150.Fl ef Pa /etc/pf.conf 151.It Cm spamd_black 152The script 153.Pa /etc/rc.d/spamd 154uses 155.Fl b 156in front of any other configured command line arguments when running 157.Xr spamd 8 158and 159.Xr spamd-setup 8 . 160.El 161.Pp 162.Sy Auxiliary 163configuration variables mostly determine 164the locations of specific configuration files. 165The boot scripts use them as follows: 166.Bl -tag -width amd_master 167.It Cm amd_master 168The 169.Xr amd 8 170master map file. 171The script 172.Pa /etc/rc.d/amd 173appends its content to the command line when starting the auto mounter daemon. 174.It Cm shlib_dirs 175Extra shared library search path entries. 176rc calls: 177.Xr ldconfig 8 178.Pa /usr/X11R6/lib 179.Pa /usr/local/lib 180.Pf $ Brq Ar shlib_dirs 181.It Cm savecore_flags 182rc calls: 183.Xr savecore 8 184.Pf $ Brq Ar savecore_flags 185.Pa /var/crash 186.El 187.Sh EXAMPLES 188Do not start the 189.Xr dhcpd 8 190daemon when booting the system: 191.Bd -literal -offset indent 192dhcpd_flags=NO 193.Ed 194.Pp 195To run the dhcpd daemon, 196add the following line to 197.Nm rc.conf.local : 198.Bd -literal -offset indent 199dhcpd_flags= 200.Ed 201.Pp 202To start it with some options: 203.Bd -literal -offset indent 204dhcpd_flags=-A abandoned 205.Ed 206.Pp 207Run 208.Pa /etc/rc.d/messagebus 209then 210.Pa /etc/rc.d/cupsd 211with the 212.Cm start 213argument at boot time, 214and in reverse order with the 215.Cm stop 216argument at shutdown: 217.Bd -literal -offset indent 218pkg_scripts=messagebus cupsd 219.Ed 220.Pp 221The default location of the 222.Xr amd 8 223master map file is: 224.Bd -literal -offset indent 225amd_master=/etc/amd/master # AMD 'master' map 226.Ed 227.Sh SEE ALSO 228.Xr init 8 , 229.Xr intro 8 , 230.Xr rc 8 , 231.Xr rc.d 8 , 232.Xr rcctl 8 233.Sh HISTORY 234The 235.Nm 236file first appeared in 237.Ox 2.2 . 238