1 .\" $NetBSD: rc.conf.5,v 1.137 2009/09/30 18:17:22 apb Exp $
3 .\" Copyright (c) 1996 Matthew R. Green
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" Copyright (c) 1997 Curt J. Sampson
28 .\" Copyright (c) 1997 Michael W. Long
29 .\" Copyright (c) 1998-2009 The NetBSD Foundation, Inc.
30 .\" All rights reserved.
32 .\" This document is derived from works contributed to The NetBSD Foundation
35 .\" Redistribution and use in source and binary forms, with or without
36 .\" modification, are permitted provided that the following conditions
38 .\" 1. Redistributions of source code must retain the above copyright
39 .\" notice, this list of conditions and the following disclaimer.
40 .\" 2. Redistributions in binary form must reproduce the above copyright
41 .\" notice, this list of conditions and the following disclaimer in the
42 .\" documentation and/or other materials provided with the distribution.
43 .\" 3. The name of the author may not be used to endorse or promote products
44 .\" derived from this software without specific prior written permission.
46 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
47 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
48 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
49 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
50 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
51 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
52 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
53 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
54 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
55 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 .Dd September 30, 2009
63 .Nd system startup configuration file
67 file specifies which services are enabled during system startup by
68 the startup scripts invoked by
72 and the shutdown scripts invoked by
73 .Pa /etc/rc.shutdown .
76 file is a shell script that is sourced by
80 must contain valid shell commands.
82 Listed below are the standard
84 variables that may be set, the values to which each may be set,
85 a brief description of what each variable does, and a reference to
86 relevant manual pages.
87 Third party packages may test for additional variables.
92 .Pa /etc/defaults/rc.conf
94 to obtain default values for various variables, and the end-user
95 may override these by appending appropriate entries to the end of
103 also support sourcing an optional end-user provided per-script override
105 .Pa /etc/rc.conf.d/ Ns Ar service ,
108 is the contents of the
113 This may contain variable overrides, including allowing the end-user
117 control variables, and thus changing the operation of the script
118 without requiring editing of the script.
119 .Ss Variable naming conventions and data types
120 Most variables are one of two types: enabling variables or flags
122 Enabling variables, such as
124 are generally named after the program or the system they enable,
125 and have boolean values (specified using
137 for false, with the values being case insensitive).
138 Flags variables, such as
140 have the same name with "_flags" appended, and determine what
141 arguments are passed to the program if it is enabled.
145 expects to be set is not set, or the value is not one of the allowed
146 values, a warning will be printed.
148 .Bl -tag -width net_interfaces
154 .Pa /etc/rc.shutdown .
155 .It Sy rcshutdown_rcorder_flags
157 Extra arguments to the
160 .Pa /etc/rc.shutdown .
161 .It Sy rcshutdown_timeout
163 If non-blank, use this as the number of seconds to run a watchdog timer for
166 if the timer expires before the shutdown script completes.
169 If false then the system will drop into single-user mode during boot.
170 .It Sy rc_fast_and_loose
171 If set to a non-empty string,
174 will be executed in the current shell rather than a sub shell.
175 This may be faster on slow machines that have an expensive
180 Use this at your own risk!
181 A rogue command or script may inadvertently prevent boot to multiuser.
183 .It Sy rc_rcorder_flags
185 Extra arguments to the
189 .It Sy rc_directories
191 Space separated list of directories searched for rc scripts.
196 must be located in the root filesystem, otherwise they will be silently
200 If true then the usual output is suppressed, and
202 invokes the command specified in the
204 variable once for each line of suppressed output.
215 A command to be executed once per line of suppressed output, when
222 which will display a spinning symbol instead of each line of output.
223 Another useful value is
225 which will display nothing at all.
227 .Ss Basic network configuration
228 .Bl -tag -width net_interfaces
231 Default IPv4 network route.
232 If empty or not set, then the contents of
234 (if it exists) are used.
237 Default IPv6 network route.
238 If empty or not set, then the contents of
240 (if it exists) are used.
245 If empty or not set, then the contents of
246 .Pa /etc/defaultdomain
247 (if it exists) are used.
248 .It Sy force_down_interfaces
249 A space separated list of interface names.
250 These interfaces will be configured down when going from multiuser to singleuser
251 mode or on system shutdown.
253 This is important for some stateful interfaces, for example PPP over ISDN
254 connections that cost money by connection time or PPPoE interfaces which
255 have no direct means of noticing
263 interfaces will be automatically added to this list.
267 If empty or not set, then the contents of
269 (if it exists) are used.
271 .Ss Boottime file-system and swap configuration
272 .Bl -tag -width net_interfaces
273 .It Sy critical_filesystems_local
275 File systems mounted very early in the system boot before networking
276 services are available.
279 is part of this, because it is needed by services such as
281 which may be required to get the network operational.
283 .Dq "OPTIONAL:/var" ,
286 prefix means that it's not an error if the file system is not
289 .It Sy critical_filesystems_remote
293 that may require network services to be available to mount,
294 that must be available early in the system boot for general services to use.
296 .Dq "OPTIONAL:/usr" ,
299 prefix means that it's not an error if the file system is not
304 A file system is checked with
306 during boot before mounting it.
307 This option may be used to override the default command-line options
315 assumes yes as the answer to all operator questions during file system checks.
316 This might be important with hosts where the administrator does not have
317 access to the console and an unsuccessful shutdown must not make the host
318 unbootable even if the file system checks would fail in preen mode.
321 Should be true if you have deliberately configured your system with no swap.
322 If false and no swap devices are configured, the system will warn you.
325 Remove block-type swap devices at shutdown time.
326 Useful if swapping onto RAIDframe devices.
328 .Ss One-time actions to perform or programs to run on boot-up
329 .Bl -tag -width net_interfaces
332 Enables process accounting with
335 .Pa /var/account/acct
339 Clear /tmp after reboot.
343 .Pa /var/run/dmesg.boot
359 for how to set mixer values.
362 the devices whose settings are to be saved at shutdown and
363 restored at start-up.
368 to trim logfiles before syslogd starts.
369 Intended for laptop users.
371 .Sy newsyslog_flags .
378 can be used to override the default location of the
380 temporary directories,
381 .Dq Pa /private/tmp .
386 utility one or more times according to the specification in
391 does not contain a semicolon
393 then it is expected to contain zero or more flags,
394 followed by one or more device or type names.
397 command will be executed once for each device or type name.
398 If the specified flags do not include any of
406 are added, to specify that entropy from the relevant device or type
407 should be both collected and estimated.
408 If the specified flags do not include either of
414 is added, to specify that the non-flag arguments are device names,
418 may contain multiple semicolon-separated segments, in which each
419 segment contains flags and device or type names as described above.
420 This allows different flags to be associated with different
421 device or type names.
423 .Li rndctl_flags="wd0 wd1; -t tty; -c -t net" ,
424 the following commands will be executed:
425 .Li "rndctl -c -e -d wd0" ;
426 .Li "rndctl -c -e -d wd1" ;
427 .Li "rndctl -c -e -t tty" ;
428 .Li "rndctl -c -t net" .
436 The directory where crash dumps are stored is specified by
438 The default setting is
444 to calibrate touch panel device.
451 version string in the
453 file to reflect the version of the running kernel.
458 Load Veriexec fingerprints during startup.
461 for more information.
464 Send notification mail to users if any recoverable files exist in
465 .Pa /var/tmp/vi.recover .
468 for more information.
470 .Ss System security setting
471 .Bl -tag -width net_interfaces
474 The system securelevel is set to the specified value early
475 in the boot process, before any external logins, or other programs
476 that run users job, are started.
477 If set to nothing, the default action is taken, as described in
480 .Xr secmodel_securelevel 9 ,
481 which contains definitive information about the system securelevel.
486 will actually result in the system booting with securelevel set to 1, as
488 will raise the level when
491 .It Sy permit_nonalpha
492 Allow passwords to include non-alpha characters, usually to allow
494 .It Sy veriexec_strict
496 Controls the strict level of Veriexec.
497 Level 0 is learning mode, used when building the signatures file.
498 It will only output messages but will not enforce anything.
499 Level 1 will only prevent access to files with a fingerprint
501 Level 2 will also deny writing to and removing of
502 monitored files, as well as enforce access type (as specified in
503 the signatures file).
504 Level 3 will take a step further and prevent
505 access to files that are not monitored.
506 .It Sy veriexec_verbose
508 Controls the verbosity of Veriexec.
509 Recommended operation is at level 0, verbose output (mostly used when
510 building the signatures file) is at level 1.
511 Level 2 is for debugging only and should not be used.
512 .It Sy veriexec_flags
518 .Ss Networking startup
519 .Bl -tag -width net_interfaces
522 ALTQ configuration/monitoring daemon.
529 variable (see below) to the output of
533 flag and suppresses warnings about interfaces in this list that
534 do not have an ifconfig file or variable.
537 Set true to configure some or all network interfaces using
544 .Sy critical_filesystems_local ,
547 must be on the root file system,
548 or you must modify the
550 variable to direct the DHCP client to store the leases file
551 in some other directory on the root file system.
552 You must not provide ifconfig information or ifaliases
553 information for any interface that is to be configured using the DHCP client.
554 Interface aliases can be set up in the DHCP client configuration
564 for complete documentation.
565 If you wish to configure all broadcast
566 network interfaces using the DHCP client, you can leave this blank.
567 To configure only specific interfaces, name the interfaces to be configured
570 If you must run the DHCP client before mounting critical file systems,
571 then you should specify an alternate location for the DHCP client's lease
574 variable - for example, "-lf /tmp/dhclient.leases".
576 Additional arguments to pass to
578 when requesting configuration via
581 .Pa /etc/ifconfig.xxN .
584 Flushes the route table on networking startup.
585 Useful when coming up to multiuser mode after going down to
591 the authenticator for IEEE 802.11 networks.
595 .Sq Em "address netmask"
596 pairs to configure additional network addresses for the given
600 .Sy ifaliases_le0 ) .
605 then use the default netmask for the interface.
608 covers limited cases only and considered unrecommended.
612 .Pa /etc/ifconfig.xxN
613 files with multiple lines instead.
616 Monitor dynamic interfaces and perform actions upon address changes.
621 An IPv6 node can be a router
622 .Pq nodes that forward packet for others
624 .Pq nodes that do not forward .
625 A host can be autoconfigured
626 based on the information advertised by adjacent IPv6 routers.
634 you can configure your node as a router,
635 a non-autoconfigured host, or an autoconfigured host.
636 Invalid values will be ignored, and the node will be configured as
637 a non-autoconfigured host.
638 You may want to check
642 as well, if you set the variable to
644 .It Sy ip6uniquelocal
653 a reject route will be installed on boot to avoid misconfiguration relating
654 to unique-local addresses.
657 is true, the reject route won't be installed.
662 to load in packet filter specifications from
664 at network boot time, before any interfaces are configured.
673 to save and restore information for ipnat and ipfilter state tables.
674 The information is stored in
675 .Pa /var/db/ipf/ipstate.ipf
677 .Pa /var/db/ipf/ipnat.ipf .
686 packet log information and log it to a file or the system log.
691 Specifies arguments to supply to
695 A typical example would be
696 .Dq Fl nD Pa /var/log/ipflog
699 log directly to a file bypassing
703 argument is used, remember to modify
704 .Pa /etc/newsyslog.conf
705 accordingly; for example:
707 /var/log/ipflog 640 10 100 * Z /var/run/ipmon.pid
713 to load in the IP network address translation (NAT) rules from
715 at network boot time, before any interfaces are configured.
722 to load in IPsec manual keys and policies from
724 at network boot time, before any interfaces are configured.
725 .It Sy net_interfaces
727 The list of network interfaces to be configured at boot time.
728 For each interface "xxN", the system first looks for ifconfig
729 parameters in the variable
732 .Pa /etc/ifconfig.xxN .
735 is false, and neither the variable nor the file is found,
736 a warning is printed.
737 Information in either the variable or the file is parsed identically,
740 variable contains a single line with embedded semicolons,
741 then the value is split into multiple lines prior to further parsing,
742 treating the semicolon as a line separator.
743 One common case it to set
744 .Sy ifconfig_xxN Ns Li \&= Ns Qq dhcp ,
747 to be started for the interface.
748 Another common case it to set the
750 variable to a set of arguments to be passed to an
752 command after the interface name.
756 .Pa /etc/ifconfig.xxN
757 files, and note that the information there also applies to
759 variables (after the variables are split into lines).
764 to set the system time from one of the hosts in
768 is empty, it will attempt to find a list of hosts in
776 at network boot time:
777 Load the initial configuration
779 before the network is up.
780 After the network has been configured, then load the final ruleset
786 ruleset that will be used when loading the final ruleset.
791 for dumping packet filter logging information to a file.
798 will check each word in
800 for a corresponding ppp configuration file in
811 the IKE (ISAKMP/Oakley) key management daemon.
816 router solicitation command for IPv6 hosts.
817 On nomadic hosts like notebook computers, you may want to enable
822 This is only for autoconfigured IPv6 hosts, so set
827 .It Sy wpa_supplicant
830 .Xr wpa_supplicant 8 ,
831 WPA/802.11i Supplicant for wireless network devices.
837 .Sy critical_filesystems_local ,
840 must be on the root file system.
842 .Ss Daemons required by other daemons
843 .Bl -tag -width net_interfaces
848 daemon to start network server processes (as listed in
849 .Pa /etc/inetd.conf )
855 flag turns on libwrap connection logging.
860 daemon is required for any
865 .Xr rpc.bootparamd 8 ,
873 .Ss Commonly used daemons
874 .Bl -tag -width net_interfaces
893 The default setting is
901 and cause it to switch to the specified user after initialization.
906 is requiring extra privileges to start listening on default port 80.
907 The default setting is
917 flag will turn on extra logging.
924 .It Sy named_chrootdir
930 as the unprivileged user and group
934 .Sy named_chrootdir .
935 .Sy named_chrootdir Ns Pa /var/run/log
936 will be added to the list of log sockets that
945 .It Sy ntpd_chrootdir
951 as the unprivileged user and group
956 .Sy ntpd_chrootdir Ns Pa /var/run/log
957 will be added to the list of log sockets that
960 This option requires that the kernel has
961 .Dl pseudo-device clockctl
962 compiled in, and that
992 to be a master time source as well as a slave.
993 If you are also running
995 only one machine running both should have the
1001 .Bl -tag -width net_interfaces
1006 the DVMRP multicast routing protocol daemon.
1013 the RIPng routing protocol daemon for IPv6.
1020 the RIP routing protocol daemon.
1023 .\" This should be false
1031 the IPv6 router solicitation daemon.
1033 periodically transmits router solicitation packets
1034 to find IPv6 routers on the network.
1035 This configuration is mainly for nomadic hosts like notebook computers.
1036 Stationary hosts should work fine with just
1040 This is only for autoconfigured IPv6 hosts, so set
1046 .Ss Daemons used to boot other hosts over a network
1047 .Bl -tag -width net_interfaces
1052 the boot parameter server, with
1053 .Sy bootparamd_flags
1064 the Dynamic Host Configuration Protocol (DHCP) daemon,
1065 for assigning IP addresses to hosts and passing boot information.
1073 .Sy dhcrelay_flags .
1081 protocol daemon; used for booting
1092 the Sun Network Disk (ND) Protocol server.
1099 the reverse ARP daemon, often used to boot
1101 and Sun workstations.
1110 boot protocol daemon; used for booting
1119 the IPv6 router advertisement daemon, which is used to advertise
1120 information about the subnet to IPv6 end hosts.
1123 This is only for IPv6 routers, so set
1129 .Ss X Window System daemons
1130 .Bl -tag -width net_interfaces
1136 These X daemons are available only with the optional X distribution of
1142 X11 font server, which supplies local X font files to X terminals.
1144 .Ss NIS (YP) daemons
1145 .Bl -tag -width net_interfaces
1152 (YP) clients use information from a
1163 users to update password on master server.
1165 .Sy yppasswdd_flags .
1172 (YP) server for distributing information from certain files in
1178 flag causes it to use DNS for lookups in
1182 .Ss NFS daemons and parameters
1183 .Bl -tag -width net_interfaces
1188 the automounter daemon, which automatically mounts NFS file systems
1189 whenever a file or directory within that file system is accessed.
1219 The number of local NFS asynchronous I/O server is now controlled via
1223 Sets up a host to be a NFS server by running
1231 a status monitoring daemon used when
1241 .Ss Bluetooth configuration and daemons
1242 .Bl -tag -width net_interfaces
1245 Attach serial bluetooth interfaces as listed in the configuration file
1246 .Pa /etc/bluetooth/btdevctl.conf .
1249 Configure bluetooth devices.
1251 .Sy btconfig_devices
1252 variable below is not specified, all devices known to the system
1254 For each device, configuration arguments are first looked for
1257 variable, otherwise the value of the
1259 variable will be used, and if that is not specified the default string is
1261 .It Sy btconfig_devices
1262 An optional space separated list of bluetooth devices to be configured at
1264 .It Sy btconfig_args
1265 An optional string, containing default arguments for bluetooth devices to
1269 Configure Bluetooth devices as listed in the configuration file
1270 .Pa /etc/bluetooth/btdevctl.conf .
1275 the Bluetooth HCI daemon, which manages link keys and PIN codes for
1281 Runs the Service Discovery Profile daemon,
1287 .Bl -tag -width net_interfaces
1292 the isdn4bsd ISDN connection management daemon.
1295 .It Sy isdn_autoupdown
1297 Set all configured ISDN interfaces to
1301 is not blank, only the listed interfaces will be modified.
1309 Kerberos v4 and v5 server.
1310 This should be run on Kerberos master and slave servers.
1321 .Ss Hardware daemons
1322 .Bl -tag -width net_interfaces
1334 .Sy irdaattach_flags .
1339 to pass serial mouse data to the wscons mouse mux.
1347 .Sy screenblank_flags .
1352 console driver, from the configuration file
1353 .Pa /etc/wscons.conf .
1358 to provide copy and paste text support in wscons displays.
1360 .Sy wsmoused_flags .
1363 .Bl -tag -width /etc/defaults/rc.conf -compact
1369 .It Pa /etc/defaults/rc.conf
1370 Default settings for
1374 before the end-user configuration section.
1375 .It Pa /etc/rc.conf.d/ Ns Ar foo
1376 .Ar foo Ns No -specific