1 .\" $NetBSD: rc.conf.5,v 1.162 2015/10/09 19:49:25 plunky 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-2010 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
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 file system, 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 single-user
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 is 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 Set to true to have the system resize the root file system to fill its
327 Will only attempt to resize the root file system if it is of type ffs and does
328 not have logging enabled.
332 Remove block-type swap devices at shutdown time.
333 Useful if swapping onto RAIDframe devices.
335 .Ss Block device subsystems
336 .Bl -tag -width net_interfaces
339 Configures concatenated disk devices according to
343 Configures cryptographic disk devices.
345 .Pa /etc/cgd/cgd.conf .
348 for additional details.
351 Configures the logical volume manager.
354 for additional details.
359 RAIDframe disk devices.
362 for additional details.
364 .Ss One-time actions to perform or programs to run on boot-up
365 .Bl -tag -width net_interfaces
368 Enables process accounting with
371 .Pa /var/account/acct
381 .Pa /var/run/dmesg.boot
388 Sets preferences for the environmental systems framework,
391 .Pa /etc/envsys.conf ,
392 which is described in
405 runtime link editor directory cache.
410 for how to set mixer values.
413 the devices whose settings are to be saved at shutdown and
414 restored at start-up.
419 to trim log files before syslogd starts.
420 Intended for laptop users.
422 .Sy newsyslog_flags .
429 can be used to override the default location of the
431 temporary directories,
432 .Dq Pa /private/tmp .
435 for additional details.
438 Checks and enables quotas by running
444 During boot-up, runs the
448 flag to seed the random number subsystem from an entropy file.
449 During shutdown, runs the
453 flag to save some random information to the entropy file.
454 The entropy file name is specified by the
456 variable, and defaults to
457 .Pa /var/db/entropy-file .
458 The entropy file must be on a local file system that is writable early during
459 boot-up (just after the file systems specified in
460 .Sy critical_filesystems_local
461 have been mounted), and correspondingly late during shutdown.
466 utility one or more times according to the specification in
471 does not contain a semicolon
473 then it is expected to contain zero or more flags,
474 followed by one or more device or type names.
477 command will be executed once for each device or type name.
478 If the specified flags do not include any of
486 are added, to specify that entropy from the relevant device or type
487 should be both collected and estimated.
488 If the specified flags do not include either of
494 is added, to specify that the non-flag arguments are device names,
498 may contain multiple semicolon-separated segments, in which each
499 segment contains flags and device or type names as described above.
500 This allows different flags to be associated with different
501 device or type names.
503 .Li rndctl_flags="wd0 wd1; -t tty; -c -t net" ,
504 the following commands will be executed:
505 .Li "rndctl -c -e -d wd0" ;
506 .Li "rndctl -c -e -d wd1" ;
507 .Li "rndctl -c -e -t tty" ;
508 .Li "rndctl -c -t net" .
511 Sets the real time clock to local time by adjusting the
514 .Pa kern.rtc_offset .
515 The offset from UTC is calculated automatically according
516 to the time zone information in the file
525 The directory where crash dumps are stored is specified by
527 The default setting is
531 Builds various system databases, including
532 .Pa /var/run/dev.cdb ,
534 .Pa /var/db/netgroup.db ,
535 .Pa /var/db/services.cdb ,
542 to calibrate touch panel device.
549 version string in the
551 file to reflect the version of the running kernel.
556 Send notification mail to users if any recoverable files exist in
557 .Pa /var/tmp/vi.recover .
560 for more information.
563 Configures watchdog timers.
568 for information on how to configure a timer.
570 .Ss System security settings
571 .Bl -tag -width net_interfaces
574 The system securelevel is set to the specified value early
575 in the boot process, before any external logins, or other programs
576 that run users job, are started.
577 If set to nothing, the default action is taken, as described in
580 .Xr secmodel_securelevel 9 ,
581 which contains definitive information about the system securelevel.
586 will actually result in the system booting with securelevel set to 1, as
588 will raise the level when
591 .It Sy permit_nonalpha
593 Allow passwords to include non-alpha characters, usually to allow
597 Load Veriexec fingerprints during startup.
600 for more information.
601 .It Sy veriexec_strict
603 Controls the strict level of Veriexec.
604 Level 0 is learning mode, used when building the signatures file.
605 It will only output messages but will not enforce anything.
606 Level 1 will only prevent access to files with a fingerprint
608 Level 2 will also deny writing to and removing of
609 monitored files, as well as enforce access type (as specified in
610 the signatures file).
611 Level 3 will take a step further and prevent
612 access to files that are not monitored.
613 .It Sy veriexec_verbose
615 Controls the verbosity of Veriexec.
616 Recommended operation is at level 0, verbose output (mostly used when
617 building the signatures file) is at level 1.
618 Level 2 is for debugging only and should not be used.
619 .It Sy veriexec_flags
625 .Ss Networking startup
626 .Bl -tag -width net_interfaces
629 ALTQ configuration/monitoring daemon.
636 variable (see below) to the output of
640 flag and suppresses warnings about interfaces in this list that
641 do not have an ifconfig file or variable.
644 Set true to configure some or all network interfaces using
651 .Sy critical_filesystems_local ,
654 must be on the root file system,
655 or you must modify the
657 variable to direct the DHCP client to store the leases file
658 in some other directory on the root file system.
659 You must not provide ifconfig information or ifaliases
660 information for any interface that is to be configured using the DHCP client.
661 Interface aliases can be set up in the DHCP client configuration
671 for complete documentation.
672 If you wish to configure all broadcast
673 network interfaces using the DHCP client, you can leave this blank.
674 To configure only specific interfaces, name the interfaces to be configured
677 If you must run the DHCP client before mounting critical file systems,
678 then you should specify an alternate location for the DHCP client's lease
681 variable - for example, "-lf /tmp/dhclient.leases".
684 Set true to configure some or all network interfaces using dhcpcd.
690 .Sy critical_filesystems_local ,
693 must be on the root file system.
694 If you need to restrict dhcpcd to one or a number of interfaces,
695 or need a separate configuration per interface,
696 then this should be done in the configuration file - see
699 dhcpcd presently ignores the
701 variable in rc.conf and will start wpa_supplicant if a suitable
702 wpa_supplicant.conf is found unless otherwise instructed in
710 for complete documentation.
713 Flushes the route table on networking startup.
714 Useful when coming up to multiuser mode after going down to
720 the proxy daemon for the Internet File Transfer Protocol.
725 the authenticator for IEEE 802.11 networks.
729 .Sq Em "address netmask"
730 pairs to configure additional network addresses for the given
734 .Sy ifaliases_le0 ) .
739 then use the default netmask for the interface.
742 covers limited cases only and is considered unrecommended.
746 .Pa /etc/ifconfig.xxN
747 files with multiple lines instead.
750 Monitor dynamic interfaces and perform actions upon address changes.
755 An IPv6 node can be a router
756 .Pq nodes that forward packet for others
758 .Pq nodes that do not forward .
759 A host can be autoconfigured
760 based on the information advertised by adjacent IPv6 routers.
768 you can configure your node as a router,
769 a non-autoconfigured host, or an autoconfigured host.
770 Invalid values will be ignored, and the node will be configured as
771 a non-autoconfigured host.
772 You may want to check
776 as well, if you set the variable to
778 .It Sy ip6uniquelocal
787 a reject route will be installed on boot to avoid misconfiguration relating
788 to unique-local addresses.
791 is true, the reject route won't be installed.
796 to load in packet filter specifications from
798 at network boot time, before any interfaces are configured.
807 to save and restore information for ipnat and ipfilter state tables.
808 The information is stored in
809 .Pa /var/db/ipf/ipstate.ipf
811 .Pa /var/db/ipf/ipnat.ipf .
820 packet log information and log it to a file or the system log.
825 Specifies arguments to supply to
829 A typical example would be
830 .Dq Fl nD Pa /var/log/ipflog
833 log directly to a file bypassing
837 argument is used, remember to modify
838 .Pa /etc/newsyslog.conf
839 accordingly; for example:
841 /var/log/ipflog 640 10 100 * Z /var/run/ipmon.pid
847 to load in the IP network address translation (NAT) rules from
849 at network boot time, before any interfaces are configured.
856 to load in IPsec manual keys and policies from
858 at network boot time, before any interfaces are configured.
859 .It Sy net_interfaces
861 The list of network interfaces to be configured at boot time.
862 For each interface "xxN", the system first looks for ifconfig
863 parameters in the variable
866 .Pa /etc/ifconfig.xxN .
869 is false, and neither the variable nor the file is found,
870 a warning is printed.
871 Information in either the variable or the file is parsed identically,
874 variable contains a single line with embedded semicolons,
875 then the value is split into multiple lines prior to further parsing,
876 treating the semicolon as a line separator.
878 One common case it to set the
880 variable to a set of arguments to be passed to an
882 command after the interface name.
886 .Pa /etc/ifconfig.xxN
887 files, and note that the information there also applies to
889 variables (after the variables are split into lines).
894 to set the system time from one of the hosts in
898 is empty, it will attempt to find a list of hosts in
906 at network boot time:
907 Load the initial configuration
909 before the network is up.
910 After the network has been configured, then load the final rule set
916 rule set that will be used when loading the final rule set.
921 for dumping packet filter logging information to a file.
938 will check each word in
940 for a corresponding ppp configuration file in
951 the IKE (ISAKMP/Oakley) key management daemon.
956 router solicitation command for IPv6 hosts.
957 On nomadic hosts like notebook computers, you may want to enable
962 This is only for autoconfigured IPv6 hosts, so set
967 .It Sy wpa_supplicant
970 .Xr wpa_supplicant 8 ,
971 WPA/802.11i Supplicant for wireless network devices.
977 .Sy critical_filesystems_local ,
980 must be on the root file system.
981 dhcpcd ignores this variable, see the
983 variable for details.
985 .Ss Daemons required by other daemons
986 .Bl -tag -width net_interfaces
991 daemon to start network server processes (as listed in
992 .Pa /etc/inetd.conf )
998 flag turns on libwrap connection logging.
1003 daemon is required for any
1008 .Xr rpc.bootparamd 8 ,
1016 .Ss Commonly used daemons
1017 .Bl -tag -width net_interfaces
1042 The default setting is
1044 .It Sy httpd_wwwuser
1050 and cause it to switch to the specified user after initialization.
1055 is requiring extra privileges to start listening on default port 80.
1056 The default setting is
1066 flag will turn on extra logging.
1077 .It Sy named_chrootdir
1083 as the unprivileged user and group
1087 .Sy named_chrootdir .
1088 .Sy named_chrootdir Ns Pa /var/run/log
1089 will be added to the list of log sockets that
1098 .It Sy ntpd_chrootdir
1104 as the unprivileged user and group
1108 .Sy ntpd_chrootdir .
1109 .Sy ntpd_chrootdir Ns Pa /var/run/log
1110 will be added to the list of log sockets that
1113 This option requires that the kernel has
1114 .Dl pseudo-device clockctl
1115 compiled in, and that
1145 to be a master time source as well as a slave.
1146 If you are also running
1148 only one machine running both should have the
1154 .Bl -tag -width net_interfaces
1159 the DVMRP multicast routing protocol daemon.
1166 the RIPng routing protocol daemon for IPv6.
1173 the RIP routing protocol daemon.
1176 .\" This should be false
1184 the IPv6 router solicitation daemon.
1186 periodically transmits router solicitation packets
1187 to find IPv6 routers on the network.
1188 This configuration is mainly for nomadic hosts like notebook computers.
1189 Stationary hosts should work fine with just
1193 This is only for autoconfigured IPv6 hosts, so set
1199 .Ss Daemons used to boot other hosts over a network
1200 .Bl -tag -width net_interfaces
1205 the boot parameter server, with
1206 .Sy bootparamd_flags
1217 the Dynamic Host Configuration Protocol (DHCP) daemon,
1218 for assigning IP addresses to hosts and passing boot information.
1226 .Sy dhcrelay_flags .
1234 protocol daemon; used for booting
1245 the Sun Network Disk (ND) Protocol server.
1252 the reverse ARP daemon, often used to boot
1254 and Sun workstations.
1263 boot protocol daemon; used for booting
1272 the IPv6 router advertisement daemon, which is used to advertise
1273 information about the subnet to IPv6 end hosts.
1276 This is only for IPv6 routers, so set
1282 .Ss X Window System daemons
1283 .Bl -tag -width net_interfaces
1289 These X daemons are available only with the optional X distribution of
1295 X11 font server, which supplies local X font files to X terminals.
1297 .Ss NIS (YP) daemons
1298 .Bl -tag -width net_interfaces
1305 (YP) clients use information from a
1316 users to update password on master server.
1318 .Sy yppasswdd_flags .
1325 (YP) server for distributing information from certain files in
1331 flag causes it to use DNS for lookups in
1335 .Ss NFS daemons and parameters
1336 .Bl -tag -width net_interfaces
1341 the automounter daemon, which automatically mounts NFS file systems
1342 whenever a file or directory within that file system is accessed.
1372 The number of local NFS asynchronous I/O server is now controlled via
1376 Sets up a host to be a NFS server by running
1384 a status monitoring daemon used when
1394 .Ss Bluetooth support
1395 .Bl -tag -width net_interfaces
1398 Configure Bluetooth support, comprising the following tasks:
1401 attach serial Bluetooth controllers as listed in the
1402 .Pa /etc/bluetooth/btattach.conf
1405 enable Bluetooth controllers with useful defaults, plus
1406 additional options as detailed below.
1410 the Bluetooth Link Key/PIN Code manager, passing
1413 configure local Bluetooth drivers as listed in the
1414 .Pa /etc/bluetooth/btdevctl.conf
1419 the Service Discovery server, passing
1422 .It Sy btconfig_devices
1424 An optional list of Bluetooth controllers to configure.
1425 .It Sy btconfig_{dev}
1427 Additional configuration options for specific Bluetooth controllers.
1428 .It Sy btconfig_args
1430 Additional configuration options for Bluetooth controllers without
1431 specific options as above.
1434 If set to false, disable starting the Bluetooth Link Key/PIN Code manager.
1437 If set to false, disable starting the Bluetooth Service Discovery server.
1440 .Bl -tag -width net_interfaces
1445 the daemon for the user identification protocol.
1450 Runs the server for iSCSI requests,
1451 .Xr iscsi-target 8 .
1453 .Sy iscsi_target_flags .
1458 the isdn4bsd ISDN connection management daemon.
1461 .It Sy isdn_autoupdown
1463 Set all configured ISDN interfaces to
1467 is not blank, only the listed interfaces will be modified.
1475 Kerberos v4 and v5 server.
1476 This should be run on Kerberos master and slave servers.
1487 .Ss Hardware daemons
1488 .Bl -tag -width net_interfaces
1500 .Sy irdaattach_flags .
1505 to pass serial mouse data to the wscons mouse mux.
1513 .Sy screenblank_flags .
1518 console driver, from the configuration file
1519 .Pa /etc/wscons.conf .
1524 to provide copy and paste text support in wscons displays.
1526 .Sy wsmoused_flags .
1529 .Bl -tag -width /etc/defaults/rc.conf -compact
1535 .It Pa /etc/defaults/rc.conf
1536 Default settings for
1540 before the end-user configuration section.
1541 .It Pa /etc/rc.conf.d/ Ns Ar foo
1542 .Ar foo Ns No -specific