Thu Apr 23 13:43:42 2020 UTC ()
Pull up following revision(s) (requested by kim in ticket #1537):

	share/man/man5/rc.conf.5: revision 1.172
	etc/rc.d/network: revision 1.75

Allow rc.conf to setup resolv.conf via resolvconf(8).

This allows all static network config to be in rc.conf rather than
spread across files.


(martin)
diff -r1.71 -r1.71.8.1 src/etc/rc.d/network
diff -r1.166.6.1 -r1.166.6.2 src/share/man/man5/rc.conf.5

cvs diff -r1.71 -r1.71.8.1 src/etc/rc.d/network (switch to unified diff)

--- src/etc/rc.d/network 2016/03/06 18:50:06 1.71
+++ src/etc/rc.d/network 2020/04/23 13:43:42 1.71.8.1
@@ -1,545 +1,578 @@ @@ -1,545 +1,578 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $NetBSD: network,v 1.71 2016/03/06 18:50:06 christos Exp $ 3# $NetBSD: network,v 1.71.8.1 2020/04/23 13:43:42 martin Exp $
4# 4#
5 5
6# PROVIDE: network 6# PROVIDE: network
7# REQUIRE: ipfilter ipsec mountcritlocal root tty sysctl 7# REQUIRE: ipfilter ipsec mountcritlocal root tty sysctl
8# BEFORE: NETWORKING 8# BEFORE: NETWORKING
9 9
10$_rc_subr_loaded . /etc/rc.subr 10$_rc_subr_loaded . /etc/rc.subr
11 11
12name="network" 12name="network"
13start_cmd="network_start" 13start_cmd="network_start"
14stop_cmd="network_stop" 14stop_cmd="network_stop"
15 15
16nl=' 16nl='
17' # a newline 17' # a newline
18 18
19intmissing() 19intmissing()
20{ 20{
21 local int="$1" 21 local int="$1"
22 shift 22 shift
23 for i; do 23 for i; do
24 if [ "$int" = "$i" ]; then 24 if [ "$int" = "$i" ]; then
25 return 1 25 return 1
26 fi 26 fi
27 done 27 done
28 return 0 28 return 0
29} 29}
30 30
31have_inet6() 31have_inet6()
32{ 32{
33 /sbin/ifconfig lo0 inet6 >/dev/null 2>&1 33 /sbin/ifconfig lo0 inet6 >/dev/null 2>&1
34} 34}
35 35
36network_start() 36network_start()
37{ 37{
38 # set hostname, turn on network 38 # set hostname, turn on network
39 # 39 #
40 echo "Starting network." 40 echo "Starting network."
41 41
42 network_start_hostname 42 network_start_hostname
43 network_start_domainname 43 network_start_domainname
44 network_start_loopback 44 network_start_loopback
45 have_inet6 && 45 have_inet6 &&
46 network_start_ipv6_route 46 network_start_ipv6_route
47 [ "$net_interfaces" != NO ] && 47 [ "$net_interfaces" != NO ] &&
48 network_start_interfaces 48 network_start_interfaces
49 network_start_aliases 49 network_start_aliases
50 network_start_defaultroute 50 network_start_defaultroute
51 network_start_defaultroute6 51 network_start_defaultroute6
52 have_inet6 && 52 have_inet6 &&
53 network_start_ipv6_autoconf 53 network_start_ipv6_autoconf
54 network_wait_dad 54 network_wait_dad
 55 network_start_resolv
55 network_start_local 56 network_start_local
56} 57}
57 58
58network_start_hostname() 59network_start_hostname()
59{ 60{
60 # If $hostname is set, use it for my Internet name, 61 # If $hostname is set, use it for my Internet name,
61 # otherwise use /etc/myname 62 # otherwise use /etc/myname
62 # 63 #
63 if [ -z "$hostname" ] && [ -f /etc/myname ]; then 64 if [ -z "$hostname" ] && [ -f /etc/myname ]; then
64 hostname=$(kat /etc/myname) 65 hostname=$(kat /etc/myname)
65 fi 66 fi
66 if [ -n "$hostname" ]; then 67 if [ -n "$hostname" ]; then
67 echo "Hostname: $hostname" 68 echo "Hostname: $hostname"
68 hostname $hostname 69 hostname $hostname
69 else 70 else
70 # Don't warn about it if we're going to run 71 # Don't warn about it if we're going to run
71 # DHCP later, as we will probably get the 72 # DHCP later, as we will probably get the
72 # hostname at that time. 73 # hostname at that time.
73 # 74 #
74 if ! checkyesno dhclient && ! checkyesno dhcpcd && \ 75 if ! checkyesno dhclient && ! checkyesno dhcpcd && \
75 [ -z "$(hostname)" ] 76 [ -z "$(hostname)" ]
76 then 77 then
77 warn "\$hostname not set." 78 warn "\$hostname not set."
78 fi 79 fi
79 fi 80 fi
80} 81}
81 82
82network_start_domainname() 83network_start_domainname()
83{ 84{
84 # Check $domainname first, then /etc/defaultdomain, 85 # Check $domainname first, then /etc/defaultdomain,
85 # for NIS/YP domain name 86 # for NIS/YP domain name
86 # 87 #
87 if [ -z "$domainname" ] && [ -f /etc/defaultdomain ]; then 88 if [ -z "$domainname" ] && [ -f /etc/defaultdomain ]; then
88 domainname=$(kat /etc/defaultdomain) 89 domainname=$(kat /etc/defaultdomain)
89 fi 90 fi
90 if [ -n "$domainname" ]; then 91 if [ -n "$domainname" ]; then
91 echo "NIS domainname: $domainname" 92 echo "NIS domainname: $domainname"
92 domainname $domainname 93 domainname $domainname
93 fi 94 fi
94 95
95 # Flush all routes just to make sure it is clean 96 # Flush all routes just to make sure it is clean
96 if checkyesno flushroutes; then 97 if checkyesno flushroutes; then
97 /sbin/route -qn flush 98 /sbin/route -qn flush
98 fi 99 fi
99} 100}
100 101
101network_start_loopback() 102network_start_loopback()
102{ 103{
103 # Set the address for the first loopback interface, so that the 104 # Set the address for the first loopback interface, so that the
104 # auto-route from a newly configured interface's address to lo0 105 # auto-route from a newly configured interface's address to lo0
105 # works correctly. 106 # works correctly.
106 # 107 #
107 # NOTE: obscure networking problems will occur if lo0 isn't configured. 108 # NOTE: obscure networking problems will occur if lo0 isn't configured.
108 # 109 #
109 /sbin/ifconfig lo0 inet 127.0.0.1 110 /sbin/ifconfig lo0 inet 127.0.0.1
110 111
111 # According to RFC1122, 127.0.0.0/8 must not leave the node. 112 # According to RFC1122, 127.0.0.0/8 must not leave the node.
112 # 113 #
113 /sbin/route -q add -inet 127.0.0.0 -netmask 0xff000000 127.0.0.1 -reject 114 /sbin/route -q add -inet 127.0.0.0 -netmask 0xff000000 127.0.0.1 -reject
114} 115}
115 116
116network_start_ipv6_route() 117network_start_ipv6_route()
117{ 118{
118 # IPv6 routing setups, and host/router mode selection. 119 # IPv6 routing setups, and host/router mode selection.
119 # 120 #
120 # We have IPv6 support in kernel. 121 # We have IPv6 support in kernel.
121 122
122 # disallow link-local unicast dest without outgoing scope 123 # disallow link-local unicast dest without outgoing scope
123 # identifiers. 124 # identifiers.
124 # 125 #
125 /sbin/route -q add -inet6 fe80:: -prefixlen 10 ::1 -reject 126 /sbin/route -q add -inet6 fe80:: -prefixlen 10 ::1 -reject
126 127
127 # disallow the use of the RFC3849 documentation address 128 # disallow the use of the RFC3849 documentation address
128 # 129 #
129 /sbin/route -q add -inet6 2001:db8:: -prefixlen 32 ::1 -reject 130 /sbin/route -q add -inet6 2001:db8:: -prefixlen 32 ::1 -reject
130 131
131 # IPv6 site-local scoped address prefix (fec0::/10) 132 # IPv6 site-local scoped address prefix (fec0::/10)
132 # has been deprecated by RFC3879. 133 # has been deprecated by RFC3879.
133 # 134 #
134 if [ -n "$ip6sitelocal" ]; then 135 if [ -n "$ip6sitelocal" ]; then
135 warn "\$ip6sitelocal is no longer valid" 136 warn "\$ip6sitelocal is no longer valid"
136 fi 137 fi
137 138
138 # disallow "internal" addresses to appear on the wire. 139 # disallow "internal" addresses to appear on the wire.
139 # 140 #
140 /sbin/route -q add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject 141 /sbin/route -q add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject
141 142
142 # disallow packets to malicious IPv4 compatible prefix 143 # disallow packets to malicious IPv4 compatible prefix
143 # 144 #
144 /sbin/route -q add -inet6 ::224.0.0.0 -prefixlen 100 ::1 -reject 145 /sbin/route -q add -inet6 ::224.0.0.0 -prefixlen 100 ::1 -reject
145 /sbin/route -q add -inet6 ::127.0.0.0 -prefixlen 104 ::1 -reject 146 /sbin/route -q add -inet6 ::127.0.0.0 -prefixlen 104 ::1 -reject
146 /sbin/route -q add -inet6 ::0.0.0.0 -prefixlen 104 ::1 -reject 147 /sbin/route -q add -inet6 ::0.0.0.0 -prefixlen 104 ::1 -reject
147 /sbin/route -q add -inet6 ::255.0.0.0 -prefixlen 104 ::1 -reject 148 /sbin/route -q add -inet6 ::255.0.0.0 -prefixlen 104 ::1 -reject
148 149
149 # disallow packets to malicious 6to4 prefix 150 # disallow packets to malicious 6to4 prefix
150 # 151 #
151 /sbin/route -q add -inet6 2002:e000:: -prefixlen 20 ::1 -reject 152 /sbin/route -q add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
152 /sbin/route -q add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject 153 /sbin/route -q add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject
153 /sbin/route -q add -inet6 2002:0000:: -prefixlen 24 ::1 -reject 154 /sbin/route -q add -inet6 2002:0000:: -prefixlen 24 ::1 -reject
154 /sbin/route -q add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject 155 /sbin/route -q add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject
155 156
156 # Completely disallow packets to IPv4 compatible prefix. 157 # Completely disallow packets to IPv4 compatible prefix.
157 # This may conflict with RFC1933 under following circumstances: 158 # This may conflict with RFC1933 under following circumstances:
158 # (1) An IPv6-only KAME node tries to originate packets to IPv4 159 # (1) An IPv6-only KAME node tries to originate packets to IPv4
159 # compatible destination. The KAME node has no IPv4 160 # compatible destination. The KAME node has no IPv4
160 # compatible support. Under RFC1933, it should transmit 161 # compatible support. Under RFC1933, it should transmit
161 # native IPv6 packets toward IPv4 compatible destination, 162 # native IPv6 packets toward IPv4 compatible destination,
162 # hoping it would reach a router that forwards the packet 163 # hoping it would reach a router that forwards the packet
163 # toward auto-tunnel interface. 164 # toward auto-tunnel interface.
164 # (2) An IPv6-only node originates a packet to IPv4 compatible 165 # (2) An IPv6-only node originates a packet to IPv4 compatible
165 # destination. A KAME node is acting as an IPv6 router, and 166 # destination. A KAME node is acting as an IPv6 router, and
166 # asked to forward it. 167 # asked to forward it.
167 # Due to rare use of IPv4 compatible address, and security 168 # Due to rare use of IPv4 compatible address, and security
168 # issues with it, we disable it by default. 169 # issues with it, we disable it by default.
169 # 170 #
170 /sbin/route -q add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject 171 /sbin/route -q add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject
171 172
172 /sbin/sysctl -qw net.inet6.ip6.forwarding=0 173 /sbin/sysctl -qw net.inet6.ip6.forwarding=0
173 /sbin/sysctl -qw net.inet6.ip6.accept_rtadv=0 174 /sbin/sysctl -qw net.inet6.ip6.accept_rtadv=0
174 175
175 case $ip6mode in 176 case $ip6mode in
176 router) 177 router)
177 echo 'IPv6 mode: router' 178 echo 'IPv6 mode: router'
178 /sbin/sysctl -qw net.inet6.ip6.forwarding=1 179 /sbin/sysctl -qw net.inet6.ip6.forwarding=1
179 180
180 # disallow unique-local unicast forwarding without 181 # disallow unique-local unicast forwarding without
181 # explicit configuration. 182 # explicit configuration.
182 if ! checkyesno ip6uniquelocal; then 183 if ! checkyesno ip6uniquelocal; then
183 /sbin/route -q add -inet6 fc00:: -prefixlen 7 \ 184 /sbin/route -q add -inet6 fc00:: -prefixlen 7 \
184 ::1 -reject 185 ::1 -reject
185 fi 186 fi
186 ;; 187 ;;
187 188
188 autohost) 189 autohost)
189 echo 'IPv6 mode: autoconfigured host' 190 echo 'IPv6 mode: autoconfigured host'
190 /sbin/sysctl -qw net.inet6.ip6.accept_rtadv=1 191 /sbin/sysctl -qw net.inet6.ip6.accept_rtadv=1
191 ;; 192 ;;
192 193
193 host)  194 host)
194 echo 'IPv6 mode: host' 195 echo 'IPv6 mode: host'
195 ;; 196 ;;
196 197
197 *) warn "invalid \$ip6mode value "\"$ip6mode\" 198 *) warn "invalid \$ip6mode value "\"$ip6mode\"
198 ;; 199 ;;
199 200
200 esac 201 esac
201} 202}
202 203
203network_start_interfaces() 204network_start_interfaces()
204{ 205{
205 # Configure all of the network interfaces listed in $net_interfaces; 206 # Configure all of the network interfaces listed in $net_interfaces;
206 # if $auto_ifconfig is YES, grab all interfaces from ifconfig. 207 # if $auto_ifconfig is YES, grab all interfaces from ifconfig.
207 # In the following, "xxN" stands in for interface names, like "le0". 208 # In the following, "xxN" stands in for interface names, like "le0".
208 # 209 #
209 # For any interfaces that has an $ifconfig_xxN variable 210 # For any interfaces that has an $ifconfig_xxN variable
210 # associated, we break it into lines using ';' as a separator, 211 # associated, we break it into lines using ';' as a separator,
211 # then process it just like the contents of an /etc/ifconfig.xxN 212 # then process it just like the contents of an /etc/ifconfig.xxN
212 # file. 213 # file.
213 # 214 #
214 # For each line from the $ifconfig_xxN variable or the 215 # For each line from the $ifconfig_xxN variable or the
215 # /etc/ifconfig.xxN file, we ignore comments and blank lines, 216 # /etc/ifconfig.xxN file, we ignore comments and blank lines,
216 # treat lines beginning with "!" as commands to execute, treat 217 # treat lines beginning with "!" as commands to execute, treat
217 # "dhcp" as a special case to invoke dhcpcd, and for any other 218 # "dhcp" as a special case to invoke dhcpcd, and for any other
218 # line we run "ifconfig xxN", using each line of the file as the 219 # line we run "ifconfig xxN", using each line of the file as the
219 # arguments for a separate "ifconfig" invocation. 220 # arguments for a separate "ifconfig" invocation.
220 # 221 #
221 # In order to configure an interface reasonably, you at the very least 222 # In order to configure an interface reasonably, you at the very least
222 # need to specify "[addr_family] [hostname]" (e.g "inet my.domain.org"), 223 # need to specify "[addr_family] [hostname]" (e.g "inet my.domain.org"),
223 # and probably a netmask (as in "netmask 0xffffffe0"). You will 224 # and probably a netmask (as in "netmask 0xffffffe0"). You will
224 # frequently need to specify a media type, as in "media UTP", for 225 # frequently need to specify a media type, as in "media UTP", for
225 # interface cards with multiple media connections that do not 226 # interface cards with multiple media connections that do not
226 # autoconfigure. See the ifconfig manual page for details. 227 # autoconfigure. See the ifconfig manual page for details.
227 # 228 #
228 # Note that /etc/ifconfig.xxN takes multiple lines. The following 229 # Note that /etc/ifconfig.xxN takes multiple lines. The following
229 # configuration is possible: 230 # configuration is possible:
230 # inet 10.1.1.1 netmask 0xffffff00 231 # inet 10.1.1.1 netmask 0xffffff00
231 # inet 10.1.1.2 netmask 0xffffff00 alias 232 # inet 10.1.1.2 netmask 0xffffff00 alias
232 # inet6 2001:db8::1 prefixlen 64 alias 233 # inet6 2001:db8::1 prefixlen 64 alias
233 # 234 #
234 # You can put shell script fragment into /etc/ifconfig.xxN by 235 # You can put shell script fragment into /etc/ifconfig.xxN by
235 # starting a line with "!". Refer to ifconfig.if(5) for details. 236 # starting a line with "!". Refer to ifconfig.if(5) for details.
236 # 237 #
237 ifaces="$(/sbin/ifconfig -l)" 238 ifaces="$(/sbin/ifconfig -l)"
238 if checkyesno auto_ifconfig; then 239 if checkyesno auto_ifconfig; then
239 tmp="$ifaces" 240 tmp="$ifaces"
240 for cloner in $(/sbin/ifconfig -C); do 241 for cloner in $(/sbin/ifconfig -C); do
241 for int in /etc/ifconfig.${cloner}[0-9]*; do 242 for int in /etc/ifconfig.${cloner}[0-9]*; do
242 [ ! -f $int ] && break 243 [ ! -f $int ] && break
243 tmp="$tmp ${int##*.}" 244 tmp="$tmp ${int##*.}"
244 done 245 done
245 done 246 done
246 else 247 else
247 tmp="$net_interfaces" 248 tmp="$net_interfaces"
248 fi 249 fi
249 echo -n 'Configuring network interfaces:' 250 echo -n 'Configuring network interfaces:'
250 for int in $tmp; do 251 for int in $tmp; do
251 eval argslist=\$ifconfig_$int 252 eval argslist=\$ifconfig_$int
252 253
253 # Skip interfaces that do not have explicit 254 # Skip interfaces that do not have explicit
254 # configuration information. If auto_ifconfig is 255 # configuration information. If auto_ifconfig is
255 # false then also warn about such interfaces. 256 # false then also warn about such interfaces.
256 # 257 #
257 if [ -z "$argslist" ] && ! [ -f /etc/ifconfig.$int ] 258 if [ -z "$argslist" ] && ! [ -f /etc/ifconfig.$int ]
258 then 259 then
259 if ! checkyesno auto_ifconfig; then 260 if ! checkyesno auto_ifconfig; then
260 echo 261 echo
261 warn \ 262 warn \
262 "/etc/ifconfig.$int missing and ifconfig_$int not set;" 263 "/etc/ifconfig.$int missing and ifconfig_$int not set;"
263 warn "interface $int not configured." 264 warn "interface $int not configured."
264 fi 265 fi
265 continue 266 continue
266 fi 267 fi
267 268
268 echo -n " $int" 269 echo -n " $int"
269 270
270 # Create the interface if necessary. 271 # Create the interface if necessary.
271 # If the interface did not exist before, 272 # If the interface did not exist before,
272 # then also resync ipf(4). 273 # then also resync ipf(4).
273 # 274 #
274 if intmissing $int $ifaces; then 275 if intmissing $int $ifaces; then
275 if /sbin/ifconfig $int create && \ 276 if /sbin/ifconfig $int create && \
276 checkyesno ipfilter; then 277 checkyesno ipfilter; then
277 /sbin/ipf -y >/dev/null 278 /sbin/ipf -y >/dev/null
278 fi 279 fi
279 fi 280 fi
280 281
281 # If $ifconfig_xxN is empty, then use 282 # If $ifconfig_xxN is empty, then use
282 # /etc/ifconfig.xxN, which we know exists due to 283 # /etc/ifconfig.xxN, which we know exists due to
283 # an earlier test. 284 # an earlier test.
284 # 285 #
285 # If $ifconfig_xxN is non-empty and contains a 286 # If $ifconfig_xxN is non-empty and contains a
286 # newline, then just use it as is. (This allows 287 # newline, then just use it as is. (This allows
287 # semicolons through unmolested.) 288 # semicolons through unmolested.)
288 # 289 #
289 # If $ifconfig_xxN is non-empty and does not 290 # If $ifconfig_xxN is non-empty and does not
290 # contain a newline, then convert all semicolons 291 # contain a newline, then convert all semicolons
291 # to newlines. 292 # to newlines.
292 # 293 #
293 case "$argslist" in 294 case "$argslist" in
294 '') 295 '')
295 cat /etc/ifconfig.$int 296 cat /etc/ifconfig.$int
296 ;; 297 ;;
297 *"${nl}"*) 298 *"${nl}"*)
298 echo "$argslist" 299 echo "$argslist"
299 ;; 300 ;;
300 *) 301 *)
301 ( 302 (
302 set -o noglob 303 set -o noglob
303 IFS=';'; set -- $argslist 304 IFS=';'; set -- $argslist
304 #echo >&2 "[$#] [$1] [$2] [$3] [$4]" 305 #echo >&2 "[$#] [$1] [$2] [$3] [$4]"
305 IFS="$nl"; echo "$*" 306 IFS="$nl"; echo "$*"
306 ) 307 )
307 ;; 308 ;;
308 esac | 309 esac |
309 collapse_backslash_newline | 310 collapse_backslash_newline |
310 while read -r args; do 311 while read -r args; do
311 case "$args" in 312 case "$args" in
312 ''|"#"*|create) 313 ''|"#"*|create)
313 ;; 314 ;;
314 "!"*) 315 "!"*)
315 # Run arbitrary command in a subshell. 316 # Run arbitrary command in a subshell.
316 ( eval "${args#*!}" ) 317 ( eval "${args#*!}" )
317 ;; 318 ;;
318 dhcp) 319 dhcp)
319 if ! checkyesno dhcpcd; then 320 if ! checkyesno dhcpcd; then
320 /sbin/dhcpcd -n \ 321 /sbin/dhcpcd -n \
321 ${dhcpcd_flags} $int 322 ${dhcpcd_flags} $int
322 fi 323 fi
323 ;; 324 ;;
324 *) 325 *)
325 # Pass args to ifconfig. Note 326 # Pass args to ifconfig. Note
326 # that args may contain embedded 327 # that args may contain embedded
327 # shell metacharacters, such as 328 # shell metacharacters, such as
328 # "ssid 'foo;*>bar'". We eval 329 # "ssid 'foo;*>bar'". We eval
329 # one more time so that things 330 # one more time so that things
330 # like ssid "Columbia University" work. 331 # like ssid "Columbia University" work.
331 ( 332 (
332 set -o noglob 333 set -o noglob
333 eval set -- $args 334 eval set -- $args
334 #echo >&2 "[$#] [$1] [$2] [$3]" 335 #echo >&2 "[$#] [$1] [$2] [$3]"
335 /sbin/ifconfig $int "$@" 336 /sbin/ifconfig $int "$@"
336 ) 337 )
337 ;; 338 ;;
338 esac 339 esac
339 done 340 done
340 configured_interfaces="$configured_interfaces $int" 341 configured_interfaces="$configured_interfaces $int"
341 done 342 done
342 echo "." 343 echo "."
343} 344}
344 345
345network_start_aliases() 346network_start_aliases()
346{ 347{
347 echo -n "Adding interface aliases:" 348 echo -n "Adding interface aliases:"
348 349
349 # Check if each configured interface xxN has an $ifaliases_xxN variable 350 # Check if each configured interface xxN has an $ifaliases_xxN variable
350 # associated, then configure additional IP addresses for that interface. 351 # associated, then configure additional IP addresses for that interface.
351 # The variable contains a list of "address netmask" pairs, with 352 # The variable contains a list of "address netmask" pairs, with
352 # "netmask" set to "-" if the interface default netmask is to be used. 353 # "netmask" set to "-" if the interface default netmask is to be used.
353 # 354 #
354 # Note that $ifaliases_xxN works only in certain cases and its 355 # Note that $ifaliases_xxN works only in certain cases and its
355 # use is not recommended. Use /etc/ifconfig.xxN or multiple 356 # use is not recommended. Use /etc/ifconfig.xxN or multiple
356 # commands in $ifconfig_xxN instead. 357 # commands in $ifconfig_xxN instead.
357 # 358 #
358 for int in lo0 $configured_interfaces; do 359 for int in lo0 $configured_interfaces; do
359 eval args=\$ifaliases_$int 360 eval args=\$ifaliases_$int
360 if [ -n "$args" ]; then 361 if [ -n "$args" ]; then
361 set -- $args 362 set -- $args
362 while [ $# -ge 2 ]; do 363 while [ $# -ge 2 ]; do
363 addr=$1 ; net=$2 ; shift 2 364 addr=$1 ; net=$2 ; shift 2
364 if [ "$net" = "-" ]; then 365 if [ "$net" = "-" ]; then
365 # for compatibility only, obsolete 366 # for compatibility only, obsolete
366 /sbin/ifconfig $int inet alias $addr 367 /sbin/ifconfig $int inet alias $addr
367 else 368 else
368 /sbin/ifconfig $int inet alias $addr \ 369 /sbin/ifconfig $int inet alias $addr \
369 netmask $net 370 netmask $net
370 fi 371 fi
371 echo -n " $int:$addr" 372 echo -n " $int:$addr"
372 done 373 done
373 fi 374 fi
374 done 375 done
375 376
376 # /etc/ifaliases, if it exists, contains the names of additional IP 377 # /etc/ifaliases, if it exists, contains the names of additional IP
377 # addresses for each interface. It is formatted as a series of lines 378 # addresses for each interface. It is formatted as a series of lines
378 # that contain 379 # that contain
379 # address interface netmask 380 # address interface netmask
380 # 381 #
381 # Note that /etc/ifaliases works only in certain cases and its 382 # Note that /etc/ifaliases works only in certain cases and its
382 # use is not recommended. Use /etc/ifconfig.xxN or multiple 383 # use is not recommended. Use /etc/ifconfig.xxN or multiple
383 # commands in $ifconfig_xxN instead. 384 # commands in $ifconfig_xxN instead.
384 # 385 #
385 if [ -f /etc/ifaliases ]; then 386 if [ -f /etc/ifaliases ]; then
386 while read addr int net; do 387 while read addr int net; do
387 if [ -z "$net" ]; then 388 if [ -z "$net" ]; then
388 # for compatibility only, obsolete 389 # for compatibility only, obsolete
389 /sbin/ifconfig $int inet alias $addr 390 /sbin/ifconfig $int inet alias $addr
390 else 391 else
391 /sbin/ifconfig $int inet alias $addr netmask $net 392 /sbin/ifconfig $int inet alias $addr netmask $net
392 fi 393 fi
393 done < /etc/ifaliases 394 done < /etc/ifaliases
394 fi 395 fi
395 396
396 echo "." # for "Adding interface aliases:" 397 echo "." # for "Adding interface aliases:"
397} 398}
398 399
399network_start_defaultroute() 400network_start_defaultroute()
400{ 401{
401 # Check $defaultroute, then /etc/mygate, for the name or address 402 # Check $defaultroute, then /etc/mygate, for the name or address
402 # of my IPv4 gateway host. If using a name, that name must be in 403 # of my IPv4 gateway host. If using a name, that name must be in
403 # /etc/hosts. 404 # /etc/hosts.
404 # 405 #
405 if [ -z "$defaultroute" ] && [ -f /etc/mygate ]; then 406 if [ -z "$defaultroute" ] && [ -f /etc/mygate ]; then
406 defaultroute=$(kat /etc/mygate) 407 defaultroute=$(kat /etc/mygate)
407 fi 408 fi
408 if [ -n "$defaultroute" ]; then 409 if [ -n "$defaultroute" ]; then
409 /sbin/route add default $defaultroute 410 /sbin/route add default $defaultroute
410 fi 411 fi
411} 412}
412 413
413network_start_defaultroute6() 414network_start_defaultroute6()
414{ 415{
415 # Check $defaultroute6, then /etc/mygate6, for the name or address 416 # Check $defaultroute6, then /etc/mygate6, for the name or address
416 # of my IPv6 gateway host. If using a name, that name must be in 417 # of my IPv6 gateway host. If using a name, that name must be in
417 # /etc/hosts. Note that the gateway host address must be a link-local 418 # /etc/hosts. Note that the gateway host address must be a link-local
418 # address if it is not using an stf* interface. 419 # address if it is not using an stf* interface.
419 # 420 #
420 if [ -z "$defaultroute6" ] && [ -f /etc/mygate6 ]; then 421 if [ -z "$defaultroute6" ] && [ -f /etc/mygate6 ]; then
421 defaultroute6=$(kat /etc/mygate6) 422 defaultroute6=$(kat /etc/mygate6)
422 fi 423 fi
423 if [ -n "$defaultroute6" ]; then 424 if [ -n "$defaultroute6" ]; then
424 if [ "$ip6mode" = "autohost" ]; then 425 if [ "$ip6mode" = "autohost" ]; then
425 echo 426 echo
426 warn \ 427 warn \
427 "ip6mode is set to 'autohost' and a v6 default route is also set." 428 "ip6mode is set to 'autohost' and a v6 default route is also set."
428 fi 429 fi
429 /sbin/route add -inet6 default $defaultroute6 430 /sbin/route add -inet6 default $defaultroute6
430 fi 431 fi
431} 432}
432 433
433network_start_ipv6_autoconf() 434network_start_ipv6_autoconf()
434{ 435{
435 # IPv6 interface autoconfiguration. 436 # IPv6 interface autoconfiguration.
436 437
437 # dhcpcd will ensure DAD completes before forking 438 # dhcpcd will ensure DAD completes before forking
438 if checkyesnox rtsol && ! checkyesno dhcpcd; then 439 if checkyesnox rtsol && ! checkyesno dhcpcd; then
439 if [ "$ip6mode" = "autohost" ]; then 440 if [ "$ip6mode" = "autohost" ]; then
440 echo 441 echo
441 warn "rtsol has been removed, " \ 442 warn "rtsol has been removed, " \
442 "please configure dhcpcd in its place." 443 "please configure dhcpcd in its place."
443 fi 444 fi
444 fi 445 fi
445} 446}
446 447
447network_wait_dad() 448network_wait_dad()
448{ 449{
449 # Wait for the DAD flags to clear form all addresses. 450 # Wait for the DAD flags to clear form all addresses.
450 if [ -n "$ifconfig_wait_dad_flags" ]; then 451 if [ -n "$ifconfig_wait_dad_flags" ]; then
451 echo 'Waiting for DAD to complete for' \ 452 echo 'Waiting for DAD to complete for' \
452 'statically configured addresses...' 453 'statically configured addresses...'
453 ifconfig $ifconfig_wait_dad_flags 454 ifconfig $ifconfig_wait_dad_flags
454 fi 455 fi
455} 456}
456 457
 458network_start_resolv()
 459{
 460 resconf=
 461
 462 if [ -n "$dns_domain" ]; then
 463 resconf="${resconf}domain $dns_domain$nl"
 464 fi
 465 if [ -n "$dns_search" ]; then
 466 resconf="${resconf}search $dns_search$nl"
 467 fi
 468 for n in $dns_nameservers; do
 469 resconf="${resconf}nameserver $n$nl"
 470 done
 471 if [ -n "$dns_sortlist" ]; then
 472 resconf="${resconf}sortlist $dns_sortlist$nl"
 473 fi
 474 if [ -n "$dns_options" ]; then
 475 resconf="${resconf}options $dns_options$nl"
 476 fi
 477 if [ -n "$resconf" ]; then
 478 resconf="# Generated by /etc/rc.d/network$nl$resconf"
 479 echo 'Configuring resolv.conf'
 480 printf %s "$resconf" | resolvconf -m "${dns_metric:-0}" -a network
 481 fi
 482}
 483
457network_start_local() 484network_start_local()
458{ 485{
459 # XXX this must die 486 # XXX this must die
460 if [ -s /etc/netstart.local ]; then 487 if [ -s /etc/netstart.local ]; then
461 sh /etc/netstart.local start 488 sh /etc/netstart.local start
462 fi 489 fi
463} 490}
464 491
465network_stop() 492network_stop()
466{ 493{
467 echo "Stopping network." 494 echo "Stopping network."
468 495
469 network_stop_local 496 network_stop_local
 497 network_stop_resolv
470 network_stop_aliases 498 network_stop_aliases
471 [ "$net_interfaces" != NO ] && 499 [ "$net_interfaces" != NO ] &&
472 network_stop_interfaces 500 network_stop_interfaces
473 network_stop_route 501 network_stop_route
474} 502}
475 503
476network_stop_local() 504network_stop_local()
477{ 505{
478 # XXX this must die 506 # XXX this must die
479 if [ -s /etc/netstart.local ]; then 507 if [ -s /etc/netstart.local ]; then
480 sh /etc/netstart.local stop 508 sh /etc/netstart.local stop
481 fi 509 fi
482} 510}
483 511
 512network_stop_resolv()
 513{
 514 resolvconf -f -d network
 515}
 516
484network_stop_aliases() 517network_stop_aliases()
485{ 518{
486 echo "Deleting aliases." 519 echo "Deleting aliases."
487 if [ -f /etc/ifaliases ]; then 520 if [ -f /etc/ifaliases ]; then
488 while read addr int net; do 521 while read addr int net; do
489 /sbin/ifconfig $int inet delete $addr 522 /sbin/ifconfig $int inet delete $addr
490 done < /etc/ifaliases 523 done < /etc/ifaliases
491 fi 524 fi
492 525
493 for int in $(/sbin/ifconfig -lu); do 526 for int in $(/sbin/ifconfig -lu); do
494 eval args=\$ifaliases_$int 527 eval args=\$ifaliases_$int
495 if [ -n "$args" ]; then 528 if [ -n "$args" ]; then
496 set -- $args 529 set -- $args
497 while [ $# -ge 2 ]; do 530 while [ $# -ge 2 ]; do
498 addr=$1 ; net=$2 ; shift 2 531 addr=$1 ; net=$2 ; shift 2
499 /sbin/ifconfig $int inet delete $addr 532 /sbin/ifconfig $int inet delete $addr
500 done 533 done
501 fi 534 fi
502 done 535 done
503} 536}
504 537
505network_stop_interfaces() 538network_stop_interfaces()
506{ 539{
507 # down interfaces 540 # down interfaces
508 # 541 #
509 echo -n 'Downing network interfaces:' 542 echo -n 'Downing network interfaces:'
510 if checkyesno auto_ifconfig; then 543 if checkyesno auto_ifconfig; then
511 tmp=$(/sbin/ifconfig -l) 544 tmp=$(/sbin/ifconfig -l)
512 else 545 else
513 tmp="$net_interfaces" 546 tmp="$net_interfaces"
514 fi 547 fi
515 for int in $tmp; do 548 for int in $tmp; do
516 eval args=\$ifconfig_$int 549 eval args=\$ifconfig_$int
517 if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then 550 if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then
518 echo -n " $int" 551 echo -n " $int"
519 if [ -f /var/run/dhcpcd-$int.pid ]; then 552 if [ -f /var/run/dhcpcd-$int.pid ]; then
520 /sbin/dhcpcd -k $int 2> /dev/null 553 /sbin/dhcpcd -k $int 2> /dev/null
521 fi 554 fi
522 /sbin/ifconfig $int down 555 /sbin/ifconfig $int down
523 if /sbin/ifconfig $int destroy 2>/dev/null && \ 556 if /sbin/ifconfig $int destroy 2>/dev/null && \
524 checkyesno ipfilter; then 557 checkyesno ipfilter; then
525 # resync ipf(4) 558 # resync ipf(4)
526 /sbin/ipf -y >/dev/null 559 /sbin/ipf -y >/dev/null
527 fi 560 fi
528 fi 561 fi
529 done 562 done
530 echo "." 563 echo "."
531} 564}
532 565
533network_stop_route() 566network_stop_route()
534{ 567{
535 # flush routes 568 # flush routes
536 # 569 #
537 /sbin/route -qn flush 570 /sbin/route -qn flush
538 571
539} 572}
540 573
541load_rc_config $name 574load_rc_config $name
542load_rc_config_var dhclient dhclient 575load_rc_config_var dhclient dhclient
543load_rc_config_var dhcpcd dhcpcd 576load_rc_config_var dhcpcd dhcpcd
544load_rc_config_var ipfilter ipfilter 577load_rc_config_var ipfilter ipfilter
545run_rc_command "$1" 578run_rc_command "$1"

cvs diff -r1.166.6.1 -r1.166.6.2 src/share/man/man5/rc.conf.5 (switch to unified diff)

--- src/share/man/man5/rc.conf.5 2019/05/14 11:33:43 1.166.6.1
+++ src/share/man/man5/rc.conf.5 2020/04/23 13:43:42 1.166.6.2
@@ -1,1250 +1,1274 @@ @@ -1,1250 +1,1274 @@
1.\" $NetBSD: rc.conf.5,v 1.166.6.1 2019/05/14 11:33:43 martin Exp $ 1.\" $NetBSD: rc.conf.5,v 1.166.6.2 2020/04/23 13:43:42 martin Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 Matthew R. Green 3.\" Copyright (c) 1996 Matthew R. Green
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 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 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 21.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 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 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE. 25.\" SUCH DAMAGE.
26.\" 26.\"
27.\" Copyright (c) 1997 Curt J. Sampson 27.\" Copyright (c) 1997 Curt J. Sampson
28.\" Copyright (c) 1997 Michael W. Long 28.\" Copyright (c) 1997 Michael W. Long
29.\" Copyright (c) 1998-2010 The NetBSD Foundation, Inc. 29.\" Copyright (c) 1998-2010 The NetBSD Foundation, Inc.
30.\" All rights reserved. 30.\" All rights reserved.
31.\" 31.\"
32.\" This document is derived from works contributed to The NetBSD Foundation 32.\" This document is derived from works contributed to The NetBSD Foundation
33.\" by Luke Mewburn. 33.\" by Luke Mewburn.
34.\" 34.\"
35.\" Redistribution and use in source and binary forms, with or without 35.\" Redistribution and use in source and binary forms, with or without
36.\" modification, are permitted provided that the following conditions 36.\" modification, are permitted provided that the following conditions
37.\" are met: 37.\" are met:
38.\" 1. Redistributions of source code must retain the above copyright 38.\" 1. Redistributions of source code must retain the above copyright
39.\" notice, this list of conditions and the following disclaimer. 39.\" notice, this list of conditions and the following disclaimer.
40.\" 2. Redistributions in binary form must reproduce the above copyright 40.\" 2. Redistributions in binary form must reproduce the above copyright
41.\" notice, this list of conditions and the following disclaimer in the 41.\" notice, this list of conditions and the following disclaimer in the
42.\" documentation and/or other materials provided with the distribution. 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 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. 44.\" derived from this software without specific prior written permission.
45.\" 45.\"
46.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 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 47.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
48.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 48.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
49.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 49.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
50.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 50.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
51.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 51.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
52.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 52.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
53.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 53.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
54.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 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 55.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56.\" SUCH DAMAGE. 56.\" SUCH DAMAGE.
57.\" 57.\"
58.Dd May 14, 2019 58.Dd April 23, 2020
59.Dt RC.CONF 5 59.Dt RC.CONF 5
60.Os 60.Os
61.Sh NAME 61.Sh NAME
62.Nm rc.conf 62.Nm rc.conf
63.Nd system startup configuration file 63.Nd system startup configuration file
64.Sh DESCRIPTION 64.Sh DESCRIPTION
65The 65The
66.Nm 66.Nm
67file specifies which services are enabled during system startup by 67file specifies which services are enabled during system startup by
68the startup scripts invoked by 68the startup scripts invoked by
69.Pa /etc/rc 69.Pa /etc/rc
70(see 70(see
71.Xr rc 8 ) , 71.Xr rc 8 ) ,
72and the shutdown scripts invoked by 72and the shutdown scripts invoked by
73.Pa /etc/rc.shutdown . 73.Pa /etc/rc.shutdown .
74The 74The
75.Nm 75.Nm
76file is a shell script that is sourced by 76file is a shell script that is sourced by
77.Xr rc 8 , 77.Xr rc 8 ,
78meaning that 78meaning that
79.Nm 79.Nm
80must contain valid shell commands. 80must contain valid shell commands.
81.Pp 81.Pp
82Listed below are the standard 82Listed below are the standard
83.Nm 83.Nm
84variables that may be set, the values to which each may be set, 84variables that may be set, the values to which each may be set,
85a brief description of what each variable does, and a reference to 85a brief description of what each variable does, and a reference to
86relevant manual pages. 86relevant manual pages.
87Third party packages may test for additional variables. 87Third party packages may test for additional variables.
88.Pp 88.Pp
89By default, 89By default,
90.Nm 90.Nm
91reads 91reads
92.Pa /etc/defaults/rc.conf 92.Pa /etc/defaults/rc.conf
93(if it is readable) 93(if it is readable)
94to obtain default values for various variables, and the end-user 94to obtain default values for various variables, and the end-user
95may override these by appending appropriate entries to the end of 95may override these by appending appropriate entries to the end of
96.Nm . 96.Nm .
97.Pp 97.Pp
98.Xr rc.d 8 98.Xr rc.d 8
99scripts that use 99scripts that use
100.Ic load_rc_config 100.Ic load_rc_config
101from 101from
102.Xr rc.subr 8 102.Xr rc.subr 8
103also support sourcing an optional end-user provided per-script override 103also support sourcing an optional end-user provided per-script override
104file 104file
105.Pa /etc/rc.conf.d/ Ns Ar service , 105.Pa /etc/rc.conf.d/ Ns Ar service ,
106(where 106(where
107.Ar service 107.Ar service
108is the contents of the 108is the contents of the
109.Sy name 109.Sy name
110variable in the 110variable in the
111.Xr rc.d 8 111.Xr rc.d 8
112script). 112script).
113This may contain variable overrides, including allowing the end-user 113This may contain variable overrides, including allowing the end-user
114to override various 114to override various
115.Ic run_rc_command 115.Ic run_rc_command
116.Xr rc.d 8 116.Xr rc.d 8
117control variables, and thus changing the operation of the script 117control variables, and thus changing the operation of the script
118without requiring editing of the script. 118without requiring editing of the script.
119.Ss Variable naming conventions and data types 119.Ss Variable naming conventions and data types
120Most variables are one of two types: enabling variables or flags 120Most variables are one of two types: enabling variables or flags
121variables. 121variables.
122Enabling variables, such as 122Enabling variables, such as
123.Sy inetd , 123.Sy inetd ,
124are generally named after the program or the system they enable, 124are generally named after the program or the system they enable,
125and have boolean values (specified using 125and have boolean values (specified using
126.Sq Ic YES , 126.Sq Ic YES ,
127.Sq Ic TRUE , 127.Sq Ic TRUE ,
128.Sq Ic ON 128.Sq Ic ON
129or 129or
130.Sq Ic 1 130.Sq Ic 1
131for true, and 131for true, and
132.Sq Ic NO , 132.Sq Ic NO ,
133.Sq Ic FALSE , 133.Sq Ic FALSE ,
134.Sq Ic OFF 134.Sq Ic OFF
135or 135or
136.Sq Ic 0 136.Sq Ic 0
137for false, with the values being case insensitive). 137for false, with the values being case insensitive).
138Flags variables, such as 138Flags variables, such as
139.Sy inetd_flags 139.Sy inetd_flags
140have the same name with "_flags" appended, and determine what 140have the same name with "_flags" appended, and determine what
141arguments are passed to the program if it is enabled. 141arguments are passed to the program if it is enabled.
142.Pp 142.Pp
143If a variable that 143If a variable that
144.Xr rc 8 144.Xr rc 8
145expects to be set is not set, or the value is not one of the allowed 145expects to be set is not set, or the value is not one of the allowed
146values, a warning will be printed. 146values, a warning will be printed.
147.Ss Overall control 147.Ss Overall control
148.Bl -tag -width net_interfaces 148.Bl -tag -width net_interfaces
149.It Sy do_rcshutdown 149.It Sy do_rcshutdown
150Boolean value. 150Boolean value.
151If false, 151If false,
152.Xr shutdown 8 152.Xr shutdown 8
153will not run 153will not run
154.Pa /etc/rc.shutdown . 154.Pa /etc/rc.shutdown .
155.It Sy rcshutdown_rcorder_flags 155.It Sy rcshutdown_rcorder_flags
156A string. 156A string.
157Extra arguments to the 157Extra arguments to the
158.Xr rcorder 8 158.Xr rcorder 8
159run by 159run by
160.Pa /etc/rc.shutdown . 160.Pa /etc/rc.shutdown .
161.It Sy rcshutdown_timeout 161.It Sy rcshutdown_timeout
162A number. 162A number.
163If non-blank, use this as the number of seconds to run a watchdog timer for 163If non-blank, use this as the number of seconds to run a watchdog timer for
164which will terminate 164which will terminate
165.Pa /etc/rc.shutdown 165.Pa /etc/rc.shutdown
166if the timer expires before the shutdown script completes. 166if the timer expires before the shutdown script completes.
167.It Sy rc_configured 167.It Sy rc_configured
168Boolean value. 168Boolean value.
169If false then the system will drop into single-user mode during boot. 169If false then the system will drop into single-user mode during boot.
170.It Sy rc_fast_and_loose 170.It Sy rc_fast_and_loose
171If set to a non-empty string, 171If set to a non-empty string,
172each script in 172each script in
173.Pa /etc/rc.d 173.Pa /etc/rc.d
174will be executed in the current shell rather than a sub shell. 174will be executed in the current shell rather than a sub shell.
175This may be faster on slow machines that have an expensive 175This may be faster on slow machines that have an expensive
176.Xr fork 2 176.Xr fork 2
177operation. 177operation.
178.Bl -hang 178.Bl -hang
179.It Em Note : 179.It Em Note :
180Use this at your own risk! 180Use this at your own risk!
181A rogue command or script may inadvertently prevent boot to multiuser. 181A rogue command or script may inadvertently prevent boot to multiuser.
182.El 182.El
183.It Sy rc_rcorder_flags 183.It Sy rc_rcorder_flags
184A string. 184A string.
185Extra arguments to the 185Extra arguments to the
186.Xr rcorder 8 186.Xr rcorder 8
187run by 187run by
188.Pa /etc/rc . 188.Pa /etc/rc .
189.It Sy rc_directories 189.It Sy rc_directories
190A string. 190A string.
191Space separated list of directories searched for rc scripts. 191Space separated list of directories searched for rc scripts.
192The default is 192The default is
193.Pa /etc/rc.d . 193.Pa /etc/rc.d .
194All directories in 194All directories in
195.Ev rc_directories 195.Ev rc_directories
196must be located in the root file system, otherwise they will be silently 196must be located in the root file system, otherwise they will be silently
197skipped. 197skipped.
198.It Sy rc_silent 198.It Sy rc_silent
199Boolean value. 199Boolean value.
200If true then the usual output is suppressed, and 200If true then the usual output is suppressed, and
201.Xr rc 8 201.Xr rc 8
202invokes the command specified in the 202invokes the command specified in the
203.Va rc_silent_cmd 203.Va rc_silent_cmd
204variable once for each line of suppressed output. 204variable once for each line of suppressed output.
205The default value of 205The default value of
206.Va rc_silent 206.Va rc_silent
207is set from the 207is set from the
208.Dv AB_SILENT 208.Dv AB_SILENT
209flag in the kernel's 209flag in the kernel's
210.Va boothowto 210.Va boothowto
211variable (see 211variable (see
212.Xr boot 8 , 212.Xr boot 8 ,
213.Xr reboot 2 ) . 213.Xr reboot 2 ) .
214.It Sy rc_silent_cmd 214.It Sy rc_silent_cmd
215A command to be executed once per line of suppressed output, when 215A command to be executed once per line of suppressed output, when
216.Va rc_silent 216.Va rc_silent
217is true. 217is true.
218The default value of 218The default value of
219.Va rc_silent_cmd 219.Va rc_silent_cmd
220is 220is
221.Dq twiddle , 221.Dq twiddle ,
222which will display a spinning symbol instead of each line of output. 222which will display a spinning symbol instead of each line of output.
223Another useful value is 223Another useful value is
224.Dq \&: , 224.Dq \&: ,
225which will display nothing at all. 225which will display nothing at all.
226.El 226.El
227.Ss Basic network configuration 227.Ss Basic network configuration
228.Bl -tag -width net_interfaces 228.Bl -tag -width net_interfaces
229.It Sy defaultroute 229.It Sy defaultroute
230A string. 230A string.
231Default IPv4 network route. 231Default IPv4 network route.
232If empty or not set, then the contents of 232If empty or not set, then the contents of
233.Pa /etc/mygate 233.Pa /etc/mygate
234(if it exists) are used. 234(if it exists) are used.
235.It Sy defaultroute6 235.It Sy defaultroute6
236A string. 236A string.
237Default IPv6 network route. 237Default IPv6 network route.
238If empty or not set, then the contents of 238If empty or not set, then the contents of
239.Pa /etc/mygate6 239.Pa /etc/mygate6
240(if it exists) are used. 240(if it exists) are used.
241.It Sy domainname 241.It Sy domainname
242A string. 242A string.
243.Tn NIS 243.Tn NIS
244(YP) domain of host. 244(YP) domain of host.
245If empty or not set, then the contents of 245If empty or not set, then the contents of
246.Pa /etc/defaultdomain 246.Pa /etc/defaultdomain
247(if it exists) are used. 247(if it exists) are used.
248.It Sy force_down_interfaces 248.It Sy force_down_interfaces
249A space separated list of interface names. 249A space separated list of interface names.
250These interfaces will be configured down when going from multiuser to single-user 250These interfaces will be configured down when going from multiuser to single-user
251mode or on system shutdown. 251mode or on system shutdown.
 252.It Sy dns_domain
 253A string.
 254Sets domain in
 255.Pa /etc/resolv.conf .
 256.It Sy dns_search
 257A string.
 258Sets search in
 259.Pa /etc/resolv.conf .
 260.It Sy dns_nameservers
 261A string of space seperated domain name servers.
 262Sets nameserver for each value in
 263.Pa /etc/resolv.conf .
 264.It Sy dns_sortlist
 265A string.
 266Sets sortlist in
 267.Pa /etc/resolv.conf .
 268.It Sy dns_options
 269A string.
 270Sets options in
 271.Pa /etc/resolv.conf .
 272.It Sy dns_metric
 273An unsigned integer.
 274Sets the priority of the above DNS to other sources, lowest wins.
 275Defaults to 0.
252.Pp 276.Pp
253This is important for some stateful interfaces, for example PPP over ISDN 277This is important for some stateful interfaces, for example PPP over ISDN
254connections that cost money by connection time or PPPoE interfaces which 278connections that cost money by connection time or PPPoE interfaces which
255have no direct means of noticing 279have no direct means of noticing
256.Dq disconnect 280.Dq disconnect
257events. 281events.
258.Pp 282.Pp
259All active 283All active
260.Xr pppoe 4 284.Xr pppoe 4
261and 285and
262.Xr ippp 4 286.Xr ippp 4
263interfaces will be automatically added to this list. 287interfaces will be automatically added to this list.
264.It Sy hostname 288.It Sy hostname
265A string. 289A string.
266Name of host. 290Name of host.
267If empty or not set, then the contents of 291If empty or not set, then the contents of
268.Pa /etc/myname 292.Pa /etc/myname
269(if it exists) are used. 293(if it exists) are used.
270.El 294.El
271.Ss Boottime file-system and swap configuration 295.Ss Boottime file-system and swap configuration
272.Bl -tag -width net_interfaces 296.Bl -tag -width net_interfaces
273.It Sy critical_filesystems_local 297.It Sy critical_filesystems_local
274A string. 298A string.
275File systems mounted very early in the system boot before networking 299File systems mounted very early in the system boot before networking
276services are available. 300services are available.
277Usually 301Usually
278.Pa /var 302.Pa /var
279is part of this, because it is needed by services such as 303is part of this, because it is needed by services such as
280.Xr dhcpcd 8 304.Xr dhcpcd 8
281which may be required to get the network operational. 305which may be required to get the network operational.
282The default is 306The default is
283.Dq "OPTIONAL:/var" , 307.Dq "OPTIONAL:/var" ,
284where the 308where the
285.Dq "OPTIONAL:" 309.Dq "OPTIONAL:"
286prefix means that it's not an error if the file system is not 310prefix means that it's not an error if the file system is not
287present in 311present in
288.Xr fstab 5 . 312.Xr fstab 5 .
289.It Sy critical_filesystems_remote 313.It Sy critical_filesystems_remote
290A string. 314A string.
291File systems such as 315File systems such as
292.Pa /usr 316.Pa /usr
293that may require network services to be available to mount, 317that may require network services to be available to mount,
294that must be available early in the system boot for general services to use. 318that must be available early in the system boot for general services to use.
295The default is 319The default is
296.Dq "OPTIONAL:/usr" , 320.Dq "OPTIONAL:/usr" ,
297where the 321where the
298.Dq "OPTIONAL:" 322.Dq "OPTIONAL:"
299prefix means that it is not an error if the file system is not 323prefix means that it is not an error if the file system is not
300present in 324present in
301.Xr fstab 5 . 325.Xr fstab 5 .
302.It Sy fsck_flags 326.It Sy fsck_flags
303A string. 327A string.
304A file system is checked with 328A file system is checked with
305.Xr fsck 8 329.Xr fsck 8
306during boot before mounting it. 330during boot before mounting it.
307This option may be used to override the default command-line options 331This option may be used to override the default command-line options
308passed to the 332passed to the
309.Xr fsck 8 333.Xr fsck 8
310program. 334program.
311.Pp 335.Pp
312When set to 336When set to
313.Fl y , 337.Fl y ,
314.Xr fsck 8 338.Xr fsck 8
315assumes yes as the answer to all operator questions during file system checks. 339assumes yes as the answer to all operator questions during file system checks.
316This might be important with hosts where the administrator does not have 340This might be important with hosts where the administrator does not have
317access to the console and an unsuccessful shutdown must not make the host 341access to the console and an unsuccessful shutdown must not make the host
318unbootable even if the file system checks would fail in preen mode. 342unbootable even if the file system checks would fail in preen mode.
319.It Sy no_swap 343.It Sy no_swap
320Boolean value. 344Boolean value.
321Should be true if you have deliberately configured your system with no swap. 345Should be true if you have deliberately configured your system with no swap.
322If false and no swap devices are configured, the system will warn you. 346If false and no swap devices are configured, the system will warn you.
323.It Sy resize_root 347.It Sy resize_root
324Boolean value. 348Boolean value.
325Set to true to have the system resize the root file system to fill its 349Set to true to have the system resize the root file system to fill its
326partition. 350partition.
327Will only attempt to resize the root file system if it is of type ffs and does 351Will only attempt to resize the root file system if it is of type ffs and does
328not have logging enabled. 352not have logging enabled.
329Defaults to false. 353Defaults to false.
330.It Sy swapoff 354.It Sy swapoff
331Boolean value. 355Boolean value.
332Remove block-type swap devices at shutdown time. 356Remove block-type swap devices at shutdown time.
333Useful if swapping onto RAIDframe devices. 357Useful if swapping onto RAIDframe devices.
334.El 358.El
335.Ss Block device subsystems 359.Ss Block device subsystems
336.Bl -tag -width net_interfaces 360.Bl -tag -width net_interfaces
337.It Sy ccd 361.It Sy ccd
338Boolean value. 362Boolean value.
339Configures concatenated disk devices according to 363Configures concatenated disk devices according to
340.Xr ccd.conf 5 . 364.Xr ccd.conf 5 .
341.It Sy cgd 365.It Sy cgd
342Boolean value. 366Boolean value.
343Configures cryptographic disk devices. 367Configures cryptographic disk devices.
344Requires 368Requires
345.Pa /etc/cgd/cgd.conf . 369.Pa /etc/cgd/cgd.conf .
346See 370See
347.Xr cgdconfig 8 371.Xr cgdconfig 8
348for additional details. 372for additional details.
349.It Sy lvm 373.It Sy lvm
350Boolean value. 374Boolean value.
351Configures the logical volume manager. 375Configures the logical volume manager.
352See 376See
353.Xr lvm 8 377.Xr lvm 8
354for additional details. 378for additional details.
355.It Sy raidframe 379.It Sy raidframe
356Boolean value. 380Boolean value.
357Configures 381Configures
358.Xr raid 4 , 382.Xr raid 4 ,
359RAIDframe disk devices. 383RAIDframe disk devices.
360See 384See
361.Xr raidctl 8 385.Xr raidctl 8
362for additional details. 386for additional details.
363.El 387.El
364.Ss One-time actions to perform or programs to run on boot-up 388.Ss One-time actions to perform or programs to run on boot-up
365.Bl -tag -width net_interfaces 389.Bl -tag -width net_interfaces
366.It Sy accounting 390.It Sy accounting
367Boolean value. 391Boolean value.
368Enables process accounting with 392Enables process accounting with
369.Xr accton 8 . 393.Xr accton 8 .
370Requires 394Requires
371.Pa /var/account/acct 395.Pa /var/account/acct
372to exist. 396to exist.
373.It Sy clear_tmp 397.It Sy clear_tmp
374Boolean value. 398Boolean value.
375Clear 399Clear
376.Pa /tmp 400.Pa /tmp
377after reboot. 401after reboot.
378.It Sy dmesg 402.It Sy dmesg
379Boolean value. 403Boolean value.
380Create 404Create
381.Pa /var/run/dmesg.boot 405.Pa /var/run/dmesg.boot
382from the output of 406from the output of
383.Xr dmesg 8 . 407.Xr dmesg 8 .
384Passes 408Passes
385.Sy dmesg_flags . 409.Sy dmesg_flags .
386.It Sy envsys 410.It Sy envsys
387Boolean value. 411Boolean value.
388Sets preferences for the environmental systems framework, 412Sets preferences for the environmental systems framework,
389.Xr envsys 4 . 413.Xr envsys 4 .
390Requires 414Requires
391.Pa /etc/envsys.conf , 415.Pa /etc/envsys.conf ,
392which is described in 416which is described in
393.Xr envsys.conf 5 . 417.Xr envsys.conf 5 .
394.It Sy gpio 418.It Sy gpio
395Boolean value. 419Boolean value.
396Configure 420Configure
397.Xr gpio 4 421.Xr gpio 4
398devices. 422devices.
399See 423See
400.Xr gpio.conf 5 . 424.Xr gpio.conf 5 .
401.It Sy ldconfig 425.It Sy ldconfig
402Boolean value. 426Boolean value.
403Configures 427Configures
404.Xr a.out 5 428.Xr a.out 5
405runtime link editor directory cache. 429runtime link editor directory cache.
406.It Sy mixerctl 430.It Sy mixerctl
407Boolean value. 431Boolean value.
408Read 432Read
409.Xr mixerctl.conf 5 433.Xr mixerctl.conf 5
410for how to set mixer values. 434for how to set mixer values.
411List in 435List in
412.Sy mixerctl_mixers 436.Sy mixerctl_mixers
413the devices whose settings are to be saved at shutdown and 437the devices whose settings are to be saved at shutdown and
414restored at start-up. 438restored at start-up.
415.It Sy newsyslog 439.It Sy newsyslog
416Boolean value. 440Boolean value.
417Run 441Run
418.Nm newsyslog 442.Nm newsyslog
419to trim log files before syslogd starts. 443to trim log files before syslogd starts.
420Intended for laptop users. 444Intended for laptop users.
421Passes 445Passes
422.Sy newsyslog_flags . 446.Sy newsyslog_flags .
423.It Sy per_user_tmp 447.It Sy per_user_tmp
424Boolean value. 448Boolean value.
425Enables a per-user 449Enables a per-user
426.Pa /tmp 450.Pa /tmp
427directory. 451directory.
428.Sy per_user_tmp_dir 452.Sy per_user_tmp_dir
429can be used to override the default location of the 453can be used to override the default location of the
430.Dq real 454.Dq real
431temporary directories, 455temporary directories,
432.Dq Pa /private/tmp . 456.Dq Pa /private/tmp .
433See 457See
434.Xr security 7 458.Xr security 7
435for additional details. 459for additional details.
436.It Sy quota 460.It Sy quota
437Boolean value. 461Boolean value.
438Checks and enables quotas by running 462Checks and enables quotas by running
439.Xr quotacheck 8 463.Xr quotacheck 8
440and 464and
441.Xr quotaon 8 . 465.Xr quotaon 8 .
442.It Sy random_seed 466.It Sy random_seed
443Boolean value. 467Boolean value.
444During boot-up, runs the 468During boot-up, runs the
445.Xr rndctl 8 469.Xr rndctl 8
446utility with the 470utility with the
447.Fl L 471.Fl L
448flag to seed the random number subsystem from an entropy file. 472flag to seed the random number subsystem from an entropy file.
449During shutdown, runs the 473During shutdown, runs the
450.Xr rndctl 8 474.Xr rndctl 8
451utility with the 475utility with the
452.Fl S 476.Fl S
453flag to save some random information to the entropy file. 477flag to save some random information to the entropy file.
454The entropy file name is specified by the 478The entropy file name is specified by the
455.Sy random_file 479.Sy random_file
456variable, and defaults to 480variable, and defaults to
457.Pa /var/db/entropy-file . 481.Pa /var/db/entropy-file .
458The entropy file must be on a local file system that is writable early during 482The entropy file must be on a local file system that is writable early during
459boot-up (just after the file systems specified in 483boot-up (just after the file systems specified in
460.Sy critical_filesystems_local 484.Sy critical_filesystems_local
461have been mounted), and correspondingly late during shutdown. 485have been mounted), and correspondingly late during shutdown.
462.It Sy rndctl 486.It Sy rndctl
463Boolean value. 487Boolean value.
464Runs the 488Runs the
465.Xr rndctl 8 489.Xr rndctl 8
466utility one or more times according to the specification in 490utility one or more times according to the specification in
467.Sy rndctl_flags . 491.Sy rndctl_flags .
468.Pp 492.Pp
469If 493If
470.Sy rndctl_flags 494.Sy rndctl_flags
471does not contain a semicolon 495does not contain a semicolon
472.Pq Ql \&; 496.Pq Ql \&;
473then it is expected to contain zero or more flags, 497then it is expected to contain zero or more flags,
474followed by one or more device or type names. 498followed by one or more device or type names.
475The 499The
476.Xr rndctl 8 500.Xr rndctl 8
477command will be executed once for each device or type name. 501command will be executed once for each device or type name.
478If the specified flags do not include any of 502If the specified flags do not include any of
479.Fl c , C , e , 503.Fl c , C , e ,
480or 504or
481.Fl E , 505.Fl E ,
482then the flags 506then the flags
483.Fl c 507.Fl c
484and 508and
485.Fl e 509.Fl e
486are added, to specify that entropy from the relevant device or type 510are added, to specify that entropy from the relevant device or type
487should be both collected and estimated. 511should be both collected and estimated.
488If the specified flags do not include either of 512If the specified flags do not include either of
489.Fl d 513.Fl d
490or 514or
491.Fl t , 515.Fl t ,
492then the flag 516then the flag
493.Fl d 517.Fl d
494is added, to specify that the non-flag arguments are device names, 518is added, to specify that the non-flag arguments are device names,
495not type names. 519not type names.
496.Pp 520.Pp
497.Sy rndctl_flags 521.Sy rndctl_flags
498may contain multiple semicolon-separated segments, in which each 522may contain multiple semicolon-separated segments, in which each
499segment contains flags and device or type names as described above. 523segment contains flags and device or type names as described above.
500This allows different flags to be associated with different 524This allows different flags to be associated with different
501device or type names. 525device or type names.
502For example, given 526For example, given
503.Li rndctl_flags="wd0 wd1; -t tty; -c -t net" , 527.Li rndctl_flags="wd0 wd1; -t tty; -c -t net" ,
504the following commands will be executed: 528the following commands will be executed:
505.Li "rndctl -c -e -d wd0" ; 529.Li "rndctl -c -e -d wd0" ;
506.Li "rndctl -c -e -d wd1" ; 530.Li "rndctl -c -e -d wd1" ;
507.Li "rndctl -c -e -t tty" ; 531.Li "rndctl -c -e -t tty" ;
508.Li "rndctl -c -t net" . 532.Li "rndctl -c -t net" .
509.It Sy rtclocaltime 533.It Sy rtclocaltime
510Boolean value. 534Boolean value.
511Sets the real time clock to local time by adjusting the 535Sets the real time clock to local time by adjusting the
512.Xr sysctl 7 536.Xr sysctl 7
513value of 537value of
514.Pa kern.rtc_offset . 538.Pa kern.rtc_offset .
515The offset from UTC is calculated automatically according 539The offset from UTC is calculated automatically according
516to the time zone information in the file 540to the time zone information in the file
517.Pa /etc/localtime . 541.Pa /etc/localtime .
518.It Sy savecore 542.It Sy savecore
519Boolean value. 543Boolean value.
520Runs the 544Runs the
521.Xr savecore 8 545.Xr savecore 8
522utility. 546utility.
523Passes 547Passes
524.Sy savecore_flags . 548.Sy savecore_flags .
525The directory where crash dumps are stored is specified by 549The directory where crash dumps are stored is specified by
526.Sy savecore_dir . 550.Sy savecore_dir .
527The default setting is 551The default setting is
528.Dq Pa /var/crash . 552.Dq Pa /var/crash .
529.It Sy sysdb 553.It Sy sysdb
530Boolean value. 554Boolean value.
531Builds various system databases, including 555Builds various system databases, including
532.Pa /var/run/dev.cdb , 556.Pa /var/run/dev.cdb ,
533.Pa /etc/spwd.db , 557.Pa /etc/spwd.db ,
534.Pa /var/db/netgroup.db , 558.Pa /var/db/netgroup.db ,
535.Pa /var/db/services.cdb , 559.Pa /var/db/services.cdb ,
536and entries for 560and entries for
537.Xr utmp 5 . 561.Xr utmp 5 .
538.It Sy tpctl 562.It Sy tpctl
539Boolean value. 563Boolean value.
540Run 564Run
541.Xr tpctl 8 565.Xr tpctl 8
542to calibrate touch panel device. 566to calibrate touch panel device.
543Passes 567Passes
544.Sy tpctl_flags . 568.Sy tpctl_flags .
545.It Sy update_motd 569.It Sy update_motd
546Boolean value. 570Boolean value.
547Updates the 571Updates the
548.Nx 572.Nx
549version string in the 573version string in the
550.Pa /etc/motd 574.Pa /etc/motd
551file to reflect the version of the running kernel. 575file to reflect the version of the running kernel.
552See 576See
553.Xr motd 5 . 577.Xr motd 5 .
554.It Sy virecover 578.It Sy virecover
555Boolean value. 579Boolean value.
556Send notification mail to users if any recoverable files exist in 580Send notification mail to users if any recoverable files exist in
557.Pa /var/tmp/vi.recover . 581.Pa /var/tmp/vi.recover .
558Read 582Read
559.Xr virecover 8 583.Xr virecover 8
560for more information. 584for more information.
561.It Sy wdogctl 585.It Sy wdogctl
562Boolean value. 586Boolean value.
563Configures watchdog timers. 587Configures watchdog timers.
564Passes 588Passes
565.Sy wdogctl_flags . 589.Sy wdogctl_flags .
566Refer to 590Refer to
567.Xr wdogctl 8 591.Xr wdogctl 8
568for information on how to configure a timer. 592for information on how to configure a timer.
569.El 593.El
570.Ss System security settings 594.Ss System security settings
571.Bl -tag -width net_interfaces 595.Bl -tag -width net_interfaces
572.It Sy securelevel 596.It Sy securelevel
573A number. 597A number.
574The system securelevel is set to the specified value early 598The system securelevel is set to the specified value early
575in the boot process, before any external logins, or other programs 599in the boot process, before any external logins, or other programs
576that run users job, are started. 600that run users job, are started.
577If set to nothing, the default action is taken, as described in 601If set to nothing, the default action is taken, as described in
578.Xr init 8 602.Xr init 8
579and 603and
580.Xr secmodel_securelevel 9 , 604.Xr secmodel_securelevel 9 ,
581which contains definitive information about the system securelevel. 605which contains definitive information about the system securelevel.
582Note that setting 606Note that setting
583.Sy securelevel 607.Sy securelevel
584to 0 in 608to 0 in
585.Nm 609.Nm
586will actually result in the system booting with securelevel set to 1, as 610will actually result in the system booting with securelevel set to 1, as
587.Xr init 8 611.Xr init 8
588will raise the level when 612will raise the level when
589.Xr rc 8 613.Xr rc 8
590completes. 614completes.
591.It Sy permit_nonalpha 615.It Sy permit_nonalpha
592Boolean value. 616Boolean value.
593Allow passwords to include non-alpha characters, usually to allow 617Allow passwords to include non-alpha characters, usually to allow
594NIS/YP netgroups. 618NIS/YP netgroups.
595.It Sy veriexec 619.It Sy veriexec
596Boolean value. 620Boolean value.
597Load Veriexec fingerprints during startup. 621Load Veriexec fingerprints during startup.
598Read 622Read
599.Xr veriexecctl 8 623.Xr veriexecctl 8
600for more information. 624for more information.
601.It Sy veriexec_strict 625.It Sy veriexec_strict
602A number. 626A number.
603Controls the strict level of Veriexec. 627Controls the strict level of Veriexec.
604Level 0 is learning mode, used when building the signatures file. 628Level 0 is learning mode, used when building the signatures file.
605It will only output messages but will not enforce anything. 629It will only output messages but will not enforce anything.
606Level 1 will only prevent access to files with a fingerprint 630Level 1 will only prevent access to files with a fingerprint
607mismatch. 631mismatch.
608Level 2 will also deny writing to and removing of 632Level 2 will also deny writing to and removing of
609monitored files, as well as enforce access type (as specified in 633monitored files, as well as enforce access type (as specified in
610the signatures file). 634the signatures file).
611Level 3 will take a step further and prevent 635Level 3 will take a step further and prevent
612access to files that are not monitored. 636access to files that are not monitored.
613.It Sy veriexec_verbose 637.It Sy veriexec_verbose
614A number. 638A number.
615Controls the verbosity of Veriexec. 639Controls the verbosity of Veriexec.
616Recommended operation is at level 0, verbose output (mostly used when 640Recommended operation is at level 0, verbose output (mostly used when
617building the signatures file) is at level 1. 641building the signatures file) is at level 1.
618Level 2 is for debugging only and should not be used. 642Level 2 is for debugging only and should not be used.
619.It Sy veriexec_flags 643.It Sy veriexec_flags
620A string. 644A string.
621Flags to pass to the 645Flags to pass to the
622.Nm veriexecctl 646.Nm veriexecctl
623command. 647command.
624.It Sy smtoff 648.It Sy smtoff
625Boolean value. 649Boolean value.
626Disables SMT (Simultaneous Multi-Threading). 650Disables SMT (Simultaneous Multi-Threading).
627.El 651.El
628.Ss Networking startup 652.Ss Networking startup
629.Bl -tag -width net_interfaces 653.Bl -tag -width net_interfaces
630.It Sy altqd 654.It Sy altqd
631Boolean value. 655Boolean value.
632ALTQ configuration/monitoring daemon. 656ALTQ configuration/monitoring daemon.
633Passes 657Passes
634.Sy altqd_flags . 658.Sy altqd_flags .
635.It Sy auto_ifconfig 659.It Sy auto_ifconfig
636Boolean value. 660Boolean value.
637Sets the 661Sets the
638.Sy net_interfaces 662.Sy net_interfaces
639variable (see below) to the output of 663variable (see below) to the output of
640.Xr ifconfig 8 664.Xr ifconfig 8
641with the 665with the
642.Dq Li -l 666.Dq Li -l
643flag and suppresses warnings about interfaces in this list that 667flag and suppresses warnings about interfaces in this list that
644do not have an ifconfig file or variable. 668do not have an ifconfig file or variable.
645.It Sy dhclient 669.It Sy dhclient
646Boolean value. 670Boolean value.
647Set true to configure some or all network interfaces using 671Set true to configure some or all network interfaces using
648the ISC DHCP client. 672the ISC DHCP client.
649If you set 673If you set
650.Sy dhclient 674.Sy dhclient
651true, then 675true, then
652.Pa /var 676.Pa /var
653must be in 677must be in
654.Sy critical_filesystems_local , 678.Sy critical_filesystems_local ,
655or 679or
656.Pa /var 680.Pa /var
657must be on the root file system, 681must be on the root file system,
658or you must modify the 682or you must modify the
659.Sy dhclient_flags 683.Sy dhclient_flags
660variable to direct the DHCP client to store the leases file 684variable to direct the DHCP client to store the leases file
661in some other directory on the root file system. 685in some other directory on the root file system.
662You must not provide ifconfig information or ifaliases 686You must not provide ifconfig information or ifaliases
663information for any interface that is to be configured using the DHCP client. 687information for any interface that is to be configured using the DHCP client.
664Interface aliases can be set up in the DHCP client configuration 688Interface aliases can be set up in the DHCP client configuration
665file if needed - see 689file if needed - see
666.Xr dhclient.conf 5 690.Xr dhclient.conf 5
667for details. 691for details.
668.Pp 692.Pp
669Passes 693Passes
670.Sy dhclient_flags 694.Sy dhclient_flags
671to the DHCP client. 695to the DHCP client.
672See 696See
673.Xr dhclient 8 697.Xr dhclient 8
674for complete documentation. 698for complete documentation.
675If you wish to configure all broadcast 699If you wish to configure all broadcast
676network interfaces using the DHCP client, you can leave this blank. 700network interfaces using the DHCP client, you can leave this blank.
677To configure only specific interfaces, name the interfaces to be configured 701To configure only specific interfaces, name the interfaces to be configured
678on the command line. 702on the command line.
679.Pp 703.Pp
680If you must run the DHCP client before mounting critical file systems, 704If you must run the DHCP client before mounting critical file systems,
681then you should specify an alternate location for the DHCP client's lease 705then you should specify an alternate location for the DHCP client's lease
682file in the 706file in the
683.Sy dhclient_flags 707.Sy dhclient_flags
684variable - for example, "-lf /tmp/dhclient.leases". 708variable - for example, "-lf /tmp/dhclient.leases".
685.It Sy dhcpcd 709.It Sy dhcpcd
686Boolean value. 710Boolean value.
687Set true to configure some or all network interfaces using dhcpcd. 711Set true to configure some or all network interfaces using dhcpcd.
688If you set 712If you set
689.Sy dhcpcd 713.Sy dhcpcd
690true, then 714true, then
691.Pa /var 715.Pa /var
692must be in 716must be in
693.Sy critical_filesystems_local , 717.Sy critical_filesystems_local ,
694or 718or
695.Pa /var 719.Pa /var
696must be on the root file system. 720must be on the root file system.
697If you need to restrict dhcpcd to one or a number of interfaces, 721If you need to restrict dhcpcd to one or a number of interfaces,
698or need a separate configuration per interface, 722or need a separate configuration per interface,
699then this should be done in the configuration file - see 723then this should be done in the configuration file - see
700.Xr dhcpcd.conf 5 724.Xr dhcpcd.conf 5
701for details. 725for details.
702dhcpcd presently ignores the 726dhcpcd presently ignores the
703.Sy wpa_supplicant 727.Sy wpa_supplicant
704variable in rc.conf and will start wpa_supplicant if a suitable 728variable in rc.conf and will start wpa_supplicant if a suitable
705wpa_supplicant.conf is found unless otherwise instructed in 729wpa_supplicant.conf is found unless otherwise instructed in
706.Xr dhcpcd.conf 5 . 730.Xr dhcpcd.conf 5 .
707.It Sy dhcpcd_flags 731.It Sy dhcpcd_flags
708Passes 732Passes
709.Sy dhcpcd_flags 733.Sy dhcpcd_flags
710to dhcpcd. 734to dhcpcd.
711See 735See
712.Xr dhcpcd 8 736.Xr dhcpcd 8
713for complete documentation. 737for complete documentation.
714.It Sy flushroutes 738.It Sy flushroutes
715Boolean value. 739Boolean value.
716Flushes the route table on networking startup. 740Flushes the route table on networking startup.
717Useful when coming up to multiuser mode after going down to 741Useful when coming up to multiuser mode after going down to
718single-user mode. 742single-user mode.
719.It Sy ftp_proxy 743.It Sy ftp_proxy
720Boolean value. 744Boolean value.
721Runs 745Runs
722.Xr ftp-proxy 8 , 746.Xr ftp-proxy 8 ,
723the proxy daemon for the Internet File Transfer Protocol. 747the proxy daemon for the Internet File Transfer Protocol.
724.It Sy hostapd 748.It Sy hostapd
725Boolean value. 749Boolean value.
726Runs 750Runs
727.Xr hostapd 8 , 751.Xr hostapd 8 ,
728the authenticator for IEEE 802.11 networks. 752the authenticator for IEEE 802.11 networks.
729.It Sy ifaliases_* 753.It Sy ifaliases_*
730A string. 754A string.
731List of 755List of
732.Sq Em "address netmask" 756.Sq Em "address netmask"
733pairs to configure additional network addresses for the given 757pairs to configure additional network addresses for the given
734configured interface 758configured interface
735.Dq * 759.Dq *
736(e.g. 760(e.g.
737.Sy ifaliases_le0 ) . 761.Sy ifaliases_le0 ) .
738If 762If
739.Em netmask 763.Em netmask
740is 764is
741.Dq - , 765.Dq - ,
742then use the default netmask for the interface. 766then use the default netmask for the interface.
743.Pp 767.Pp
744.Sy ifaliases_* 768.Sy ifaliases_*
745covers limited cases only and is considered unrecommended. 769covers limited cases only and is considered unrecommended.
746We recommend using 770We recommend using
747.Sy ifconfig_nnX 771.Sy ifconfig_nnX
748variables or 772variables or
749.Pa /etc/ifconfig.xxN 773.Pa /etc/ifconfig.xxN
750files with multiple lines instead. 774files with multiple lines instead.
751.It Sy ifwatchd 775.It Sy ifwatchd
752Boolean value. 776Boolean value.
753Monitor dynamic interfaces and perform actions upon address changes. 777Monitor dynamic interfaces and perform actions upon address changes.
754Passes 778Passes
755.Sy ifwatchd_flags . 779.Sy ifwatchd_flags .
756.It Sy ip6addrctl 780.It Sy ip6addrctl
757Boolean value. 781Boolean value.
758Fine grain control of address and routing priorities. 782Fine grain control of address and routing priorities.
759.It Sy ip6addrctl_policy 783.It Sy ip6addrctl_policy
760A string. 784A string.
761Can be: 785Can be:
762.Bl -tag -width auto -compact 786.Bl -tag -width auto -compact
763.It Li auto 787.It Li auto
764automatically determine from system settings; will read priorities from 788automatically determine from system settings; will read priorities from
765.Pa /etc/ip6addrctl.conf 789.Pa /etc/ip6addrctl.conf
766or if that file does not exist it will default to IPv6 first, then IPv4. 790or if that file does not exist it will default to IPv6 first, then IPv4.
767.It Li ipv4_prefer 791.It Li ipv4_prefer
768try IPv4 before IPv6. 792try IPv4 before IPv6.
769.It Li ipv6_prefer 793.It Li ipv6_prefer
770try IPv6 before IPv4. 794try IPv6 before IPv4.
771.El 795.El
772.It Sy ip6addrctl_verbose 796.It Sy ip6addrctl_verbose
773Boolean value. 797Boolean value.
774If set, print the resulting prefixes and priorities map. 798If set, print the resulting prefixes and priorities map.
775.It Sy ip6mode 799.It Sy ip6mode
776A string. 800A string.
777An IPv6 node can be a router 801An IPv6 node can be a router
778.Pq nodes that forward packet for others 802.Pq nodes that forward packet for others
779or a host 803or a host
780.Pq nodes that do not forward . 804.Pq nodes that do not forward .
781A host can be autoconfigured 805A host can be autoconfigured
782based on the information advertised by adjacent IPv6 routers. 806based on the information advertised by adjacent IPv6 routers.
783By setting 807By setting
784.Sy ip6mode 808.Sy ip6mode
785to 809to
786.Dq Li router , 810.Dq Li router ,
787.Dq Li host , 811.Dq Li host ,
788or 812or
789.Dq Li autohost , 813.Dq Li autohost ,
790you can configure your node as a router, 814you can configure your node as a router,
791a non-autoconfigured host, or an autoconfigured host. 815a non-autoconfigured host, or an autoconfigured host.
792Invalid values will be ignored, and the node will be configured as 816Invalid values will be ignored, and the node will be configured as
793a non-autoconfigured host. 817a non-autoconfigured host.
794You may want to check 818You may want to check
795.Sy rtsol 819.Sy rtsol
796and 820and
797.Sy rtsold 821.Sy rtsold
798as well, if you set the variable to 822as well, if you set the variable to
799.Dq Li autohost . 823.Dq Li autohost .
800.It Sy ip6uniquelocal 824.It Sy ip6uniquelocal
801Boolean value. 825Boolean value.
802If 826If
803.Sy ip6mode 827.Sy ip6mode
804is equal to 828is equal to
805.Dq Li router , 829.Dq Li router ,
806and 830and
807.Sy ip6uniquelocal 831.Sy ip6uniquelocal
808is false, 832is false,
809a reject route will be installed on boot to avoid misconfiguration relating 833a reject route will be installed on boot to avoid misconfiguration relating
810to unique-local addresses. 834to unique-local addresses.
811If 835If
812.Sy ip6uniquelocal 836.Sy ip6uniquelocal
813is true, the reject route won't be installed. 837is true, the reject route won't be installed.
814.It Sy ipfilter 838.It Sy ipfilter
815Boolean value. 839Boolean value.
816Runs 840Runs
817.Xr ipf 8 841.Xr ipf 8
818to load in packet filter specifications from 842to load in packet filter specifications from
819.Pa /etc/ipf.conf 843.Pa /etc/ipf.conf
820at network boot time, before any interfaces are configured. 844at network boot time, before any interfaces are configured.
821Passes 845Passes
822.Sy ipfilter_flags . 846.Sy ipfilter_flags .
823See 847See
824.Xr ipf.conf 5 . 848.Xr ipf.conf 5 .
825.It Sy ipfs 849.It Sy ipfs
826Boolean value. 850Boolean value.
827Runs 851Runs
828.Xr ipfs 8 852.Xr ipfs 8
829to save and restore information for ipnat and ipfilter state tables. 853to save and restore information for ipnat and ipfilter state tables.
830The information is stored in 854The information is stored in
831.Pa /var/db/ipf/ipstate.ipf 855.Pa /var/db/ipf/ipstate.ipf
832and 856and
833.Pa /var/db/ipf/ipnat.ipf . 857.Pa /var/db/ipf/ipnat.ipf .
834Passes 858Passes
835.Sy ipfs_flags . 859.Sy ipfs_flags .
836.It Sy ipmon 860.It Sy ipmon
837Boolean value. 861Boolean value.
838Runs 862Runs
839.Xr ipmon 8 863.Xr ipmon 8
840to read 864to read
841.Xr ipf 8 865.Xr ipf 8
842packet log information and log it to a file or the system log. 866packet log information and log it to a file or the system log.
843Passes 867Passes
844.Sy ipmon_flags . 868.Sy ipmon_flags .
845.It Sy ipmon_flags 869.It Sy ipmon_flags
846A string. 870A string.
847Specifies arguments to supply to 871Specifies arguments to supply to
848.Xr ipmon 8 . 872.Xr ipmon 8 .
849Defaults to 873Defaults to
850.Dq Li -ns . 874.Dq Li -ns .
851A typical example would be 875A typical example would be
852.Dq Fl nD Pa /var/log/ipflog 876.Dq Fl nD Pa /var/log/ipflog
853to have 877to have
854.Xr ipmon 8 878.Xr ipmon 8
855log directly to a file bypassing 879log directly to a file bypassing
856.Xr syslogd 8 . 880.Xr syslogd 8 .
857If the 881If the
858.Dq -D 882.Dq -D
859argument is used, remember to modify 883argument is used, remember to modify
860.Pa /etc/newsyslog.conf 884.Pa /etc/newsyslog.conf
861accordingly; for example: 885accordingly; for example:
862.Bd -literal 886.Bd -literal
863/var/log/ipflog 640 10 100 * Z /var/run/ipmon.pid 887/var/log/ipflog 640 10 100 * Z /var/run/ipmon.pid
864.Ed 888.Ed
865.It Sy ipnat 889.It Sy ipnat
866Boolean value. 890Boolean value.
867Runs 891Runs
868.Xr ipnat 8 892.Xr ipnat 8
869to load in the IP network address translation (NAT) rules from 893to load in the IP network address translation (NAT) rules from
870.Pa /etc/ipnat.conf 894.Pa /etc/ipnat.conf
871at network boot time, before any interfaces are configured. 895at network boot time, before any interfaces are configured.
872See 896See
873.Xr ipnat.conf 5 . 897.Xr ipnat.conf 5 .
874.It Sy ipsec 898.It Sy ipsec
875Boolean value. 899Boolean value.
876Runs 900Runs
877.Xr setkey 8 901.Xr setkey 8
878to load in IPsec manual keys and policies from 902to load in IPsec manual keys and policies from
879.Pa /etc/ipsec.conf 903.Pa /etc/ipsec.conf
880at network boot time, before any interfaces are configured. 904at network boot time, before any interfaces are configured.
881.It Sy net_interfaces 905.It Sy net_interfaces
882A string. 906A string.
883The list of network interfaces to be configured at boot time. 907The list of network interfaces to be configured at boot time.
884For each interface "xxN", the system first looks for ifconfig 908For each interface "xxN", the system first looks for ifconfig
885parameters in the variable 909parameters in the variable
886.Sy ifconfig_xxN , 910.Sy ifconfig_xxN ,
887and then in the file 911and then in the file
888.Pa /etc/ifconfig.xxN . 912.Pa /etc/ifconfig.xxN .
889If 913If
890.Sy auto_ifconfig 914.Sy auto_ifconfig
891is false, and neither the variable nor the file is found, 915is false, and neither the variable nor the file is found,
892a warning is printed. 916a warning is printed.
893Information in either the variable or the file is parsed identically, 917Information in either the variable or the file is parsed identically,
894except that, if an 918except that, if an
895.Sy ifconfig_xxN 919.Sy ifconfig_xxN
896variable contains a single line with embedded semicolons, 920variable contains a single line with embedded semicolons,
897then the value is split into multiple lines prior to further parsing, 921then the value is split into multiple lines prior to further parsing,
898treating the semicolon as a line separator. 922treating the semicolon as a line separator.
899.Pp 923.Pp
900One common case it to set the 924One common case it to set the
901.Sy ifconfig_xxN 925.Sy ifconfig_xxN
902variable to a set of arguments to be passed to an 926variable to a set of arguments to be passed to an
903.Xr ifconfig 8 927.Xr ifconfig 8
904command after the interface name. 928command after the interface name.
905Refer to 929Refer to
906.Xr ifconfig.if 5 930.Xr ifconfig.if 5
907for more details on 931for more details on
908.Pa /etc/ifconfig.xxN 932.Pa /etc/ifconfig.xxN
909files, and note that the information there also applies to 933files, and note that the information there also applies to
910.Sy ifconfig_xxN 934.Sy ifconfig_xxN
911variables (after the variables are split into lines). 935variables (after the variables are split into lines).
912.It Sy ntpdate 936.It Sy ntpdate
913Boolean value. 937Boolean value.
914Runs 938Runs
915.Xr ntpdate 8 939.Xr ntpdate 8
916to set the system time from one of the hosts in 940to set the system time from one of the hosts in
917.Sy ntpdate_hosts . 941.Sy ntpdate_hosts .
918If 942If
919.Sy ntpdate_hosts 943.Sy ntpdate_hosts
920is empty, it will attempt to find a list of hosts in 944is empty, it will attempt to find a list of hosts in
921.Pa /etc/ntp.conf . 945.Pa /etc/ntp.conf .
922Passes 946Passes
923.Sy ntpdate_flags . 947.Sy ntpdate_flags .
924.It Sy pf 948.It Sy pf
925Boolean value. 949Boolean value.
926Enable 950Enable
927.Xr pf 4 951.Xr pf 4
928at network boot time: 952at network boot time:
929Load the initial configuration 953Load the initial configuration
930.Xr pf.boot.conf 5 954.Xr pf.boot.conf 5
931before the network is up. 955before the network is up.
932After the network has been configured, then load the final rule set 956After the network has been configured, then load the final rule set
933.Xr pf.conf 5 . 957.Xr pf.conf 5 .
934.It Sy pf_rules 958.It Sy pf_rules
935A string. 959A string.
936The path of the 960The path of the
937.Xr pf.conf 5 961.Xr pf.conf 5
938rule set that will be used when loading the final rule set. 962rule set that will be used when loading the final rule set.
939.It Sy pflogd 963.It Sy pflogd
940Boolean value. 964Boolean value.
941Run 965Run
942.Xr pflogd 8 966.Xr pflogd 8
943for dumping packet filter logging information to a file. 967for dumping packet filter logging information to a file.
944.It Sy ppp 968.It Sy ppp
945A boolean. 969A boolean.
946Toggles starting 970Toggles starting
947.Xr pppd 8 971.Xr pppd 8
948on startup. 972on startup.
949See 973See
950.Sy ppp_peers 974.Sy ppp_peers
951below. 975below.
952.It Sy ppp_peers 976.It Sy ppp_peers
953A string. 977A string.
954If 978If
955.Sy ppp 979.Sy ppp
956is true and 980is true and
957.Sy ppp_peers 981.Sy ppp_peers
958is not empty, then 982is not empty, then
959.Pa /etc/rc.d/ppp 983.Pa /etc/rc.d/ppp
960will check each word in 984will check each word in
961.Sy ppp_peers 985.Sy ppp_peers
962for a corresponding ppp configuration file in 986for a corresponding ppp configuration file in
963.Pa /etc/ppp/peers 987.Pa /etc/ppp/peers
964and will call 988and will call
965.Xr pppd 8 989.Xr pppd 8
966with the 990with the
967.Dq call Sy peer 991.Dq call Sy peer
968option. 992option.
969.It Sy racoon 993.It Sy racoon
970Boolean value. 994Boolean value.
971Runs 995Runs
972.Xr racoon 8 , 996.Xr racoon 8 ,
973the IKE (ISAKMP/Oakley) key management daemon. 997the IKE (ISAKMP/Oakley) key management daemon.
974.It Sy rtsol 998.It Sy rtsol
975Boolean value. 999Boolean value.
976Run 1000Run
977.Xr rtsol 8 , 1001.Xr rtsol 8 ,
978router solicitation command for IPv6 hosts. 1002router solicitation command for IPv6 hosts.
979On nomadic hosts like notebook computers, you may want to enable 1003On nomadic hosts like notebook computers, you may want to enable
980.Sy rtsold 1004.Sy rtsold
981as well. 1005as well.
982Passes 1006Passes
983.Sy rtsol_flags . 1007.Sy rtsol_flags .
984This is only for autoconfigured IPv6 hosts, so set 1008This is only for autoconfigured IPv6 hosts, so set
985.Sy ip6mode 1009.Sy ip6mode
986to 1010to
987.Dq Li autohost 1011.Dq Li autohost
988if you use it. 1012if you use it.
989.It Sy wpa_supplicant 1013.It Sy wpa_supplicant
990Boolean value. 1014Boolean value.
991Run 1015Run
992.Xr wpa_supplicant 8 , 1016.Xr wpa_supplicant 8 ,
993WPA/802.11i Supplicant for wireless network devices. 1017WPA/802.11i Supplicant for wireless network devices.
994If you set 1018If you set
995.Sy wpa_supplicant 1019.Sy wpa_supplicant
996true, then 1020true, then
997.Pa /usr 1021.Pa /usr
998must be in 1022must be in
999.Sy critical_filesystems_local , 1023.Sy critical_filesystems_local ,
1000or 1024or
1001.Pa /usr 1025.Pa /usr
1002must be on the root file system. 1026must be on the root file system.
1003dhcpcd ignores this variable, see the 1027dhcpcd ignores this variable, see the
1004.Sy dhcpcd 1028.Sy dhcpcd
1005variable for details. 1029variable for details.
1006.El 1030.El
1007.Ss Daemons required by other daemons 1031.Ss Daemons required by other daemons
1008.Bl -tag -width net_interfaces 1032.Bl -tag -width net_interfaces
1009.It Sy inetd 1033.It Sy inetd
1010Boolean value. 1034Boolean value.
1011Runs the 1035Runs the
1012.Xr inetd 8 1036.Xr inetd 8
1013daemon to start network server processes (as listed in 1037daemon to start network server processes (as listed in
1014.Pa /etc/inetd.conf ) 1038.Pa /etc/inetd.conf )
1015as necessary. 1039as necessary.
1016Passes 1040Passes
1017.Sy inetd_flags . 1041.Sy inetd_flags .
1018The 1042The
1019.Dq Li -l 1043.Dq Li -l
1020flag turns on libwrap connection logging. 1044flag turns on libwrap connection logging.
1021.It Sy rpcbind 1045.It Sy rpcbind
1022Boolean value. 1046Boolean value.
1023The 1047The
1024.Xr rpcbind 8 1048.Xr rpcbind 8
1025daemon is required for any 1049daemon is required for any
1026.Xr rpc 3 1050.Xr rpc 3
1027services. 1051services.
1028These include NFS, 1052These include NFS,
1029.Tn NIS , 1053.Tn NIS ,
1030.Xr rpc.bootparamd 8 , 1054.Xr rpc.bootparamd 8 ,
1031.Xr rpc.rstatd 8 , 1055.Xr rpc.rstatd 8 ,
1032.Xr rpc.rusersd 8 , 1056.Xr rpc.rusersd 8 ,
1033and 1057and
1034.Xr rpc.rwalld 8 . 1058.Xr rpc.rwalld 8 .
1035Passes 1059Passes
1036.Sy rpcbind_flags . 1060.Sy rpcbind_flags .
1037.El 1061.El
1038.Ss Commonly used daemons 1062.Ss Commonly used daemons
1039.Bl -tag -width net_interfaces 1063.Bl -tag -width net_interfaces
1040.It Sy cron 1064.It Sy cron
1041Boolean value. 1065Boolean value.
1042Run 1066Run
1043.Xr cron 8 . 1067.Xr cron 8 .
1044.It Sy ftpd 1068.It Sy ftpd
1045Boolean value. 1069Boolean value.
1046Runs the 1070Runs the
1047.Xr ftpd 8 1071.Xr ftpd 8
1048daemon and passes 1072daemon and passes
1049.Sy ftpd_flags . 1073.Sy ftpd_flags .
1050.It Sy httpd 1074.It Sy httpd
1051Boolean value. 1075Boolean value.
1052Runs the 1076Runs the
1053.Xr httpd 8 1077.Xr httpd 8
1054daemon and passes 1078daemon and passes
1055.Sy httpd_flags . 1079.Sy httpd_flags .
1056.It Sy httpd_wwwdir 1080.It Sy httpd_wwwdir
1057A string. 1081A string.
1058The 1082The
1059.Xr httpd 8 1083.Xr httpd 8
1060WWW root directory. 1084WWW root directory.
1061Used only if 1085Used only if
1062.Sy httpd 1086.Sy httpd
1063is true. 1087is true.
1064The default setting is 1088The default setting is
1065.Dq Pa /var/www . 1089.Dq Pa /var/www .
1066.It Sy httpd_wwwuser 1090.It Sy httpd_wwwuser
1067A string. 1091A string.
1068If non-blank and 1092If non-blank and
1069.Sy httpd 1093.Sy httpd
1070is true, run 1094is true, run
1071.Xr httpd 8 1095.Xr httpd 8
1072and cause it to switch to the specified user after initialization. 1096and cause it to switch to the specified user after initialization.
1073It is preferred to 1097It is preferred to
1074.Sy httpd_user 1098.Sy httpd_user
1075because 1099because
1076.Xr httpd 8 1100.Xr httpd 8
1077is requiring extra privileges to start listening on default port 80. 1101is requiring extra privileges to start listening on default port 80.
1078The default setting is 1102The default setting is
1079.Dq Dv _httpd . 1103.Dq Dv _httpd .
1080.It Sy lpd 1104.It Sy lpd
1081Boolean value. 1105Boolean value.
1082Runs 1106Runs
1083.Xr lpd 8 1107.Xr lpd 8
1084and passes 1108and passes
1085.Sy lpd_flags . 1109.Sy lpd_flags .
1086The 1110The
1087.Dq Li -l 1111.Dq Li -l
1088flag will turn on extra logging. 1112flag will turn on extra logging.
1089.It Sy mdnsd 1113.It Sy mdnsd
1090Boolean value. 1114Boolean value.
1091Runs 1115Runs
1092.Xr mdnsd 8 . 1116.Xr mdnsd 8 .
1093.It Sy named 1117.It Sy named
1094Boolean value. 1118Boolean value.
1095Runs 1119Runs
1096.Xr named 8 1120.Xr named 8
1097and passes 1121and passes
1098.Sy named_flags . 1122.Sy named_flags .
1099.It Sy named_chrootdir 1123.It Sy named_chrootdir
1100A string. 1124A string.
1101If non-blank and 1125If non-blank and
1102.Sy named 1126.Sy named
1103is true, run 1127is true, run
1104.Xr named 8 1128.Xr named 8
1105as the unprivileged user and group 1129as the unprivileged user and group
1106.Sq named , 1130.Sq named ,
1107.Xr chroot 2 Ns ed 1131.Xr chroot 2 Ns ed
1108to 1132to
1109.Sy named_chrootdir . 1133.Sy named_chrootdir .
1110.Sy named_chrootdir Ns Pa /var/run/log 1134.Sy named_chrootdir Ns Pa /var/run/log
1111will be added to the list of log sockets that 1135will be added to the list of log sockets that
1112.Xr syslogd 8 1136.Xr syslogd 8
1113listens to. 1137listens to.
1114.It Sy ntpd 1138.It Sy ntpd
1115Boolean value. 1139Boolean value.
1116Runs 1140Runs
1117.Xr ntpd 8 1141.Xr ntpd 8
1118and passes 1142and passes
1119.Sy ntpd_flags . 1143.Sy ntpd_flags .
1120.It Sy ntpd_chrootdir 1144.It Sy ntpd_chrootdir
1121A string. 1145A string.
1122If non-blank and 1146If non-blank and
1123.Sy ntpd 1147.Sy ntpd
1124is true, run 1148is true, run
1125.Xr ntpd 8 1149.Xr ntpd 8
1126as the unprivileged user and group 1150as the unprivileged user and group
1127.Sq ntpd , 1151.Sq ntpd ,
1128.Xr chroot 2 Ns ed 1152.Xr chroot 2 Ns ed
1129to 1153to
1130.Sy ntpd_chrootdir . 1154.Sy ntpd_chrootdir .
1131.Sy ntpd_chrootdir Ns Pa /var/run/log 1155.Sy ntpd_chrootdir Ns Pa /var/run/log
1132will be added to the list of log sockets that 1156will be added to the list of log sockets that
1133.Xr syslogd 8 1157.Xr syslogd 8
1134listens to. 1158listens to.
1135This option requires that the kernel has 1159This option requires that the kernel has
1136.Dl pseudo-device clockctl 1160.Dl pseudo-device clockctl
1137compiled in, and that 1161compiled in, and that
1138.Pa /dev/clockctl 1162.Pa /dev/clockctl
1139is present. 1163is present.
1140.It Sy postfix 1164.It Sy postfix
1141Boolean value. 1165Boolean value.
1142Starts 1166Starts
1143.Xr postfix 1 1167.Xr postfix 1
1144mail system. 1168mail system.
1145.It Sy sshd 1169.It Sy sshd
1146Boolean value. 1170Boolean value.
1147Runs 1171Runs
1148.Xr sshd 8 1172.Xr sshd 8
1149and passes 1173and passes
1150.Sy sshd_flags . 1174.Sy sshd_flags .
1151.It Sy syslogd 1175.It Sy syslogd
1152Boolean value. 1176Boolean value.
1153Runs 1177Runs
1154.Xr syslogd 8 1178.Xr syslogd 8
1155and passes 1179and passes
1156.Sy syslogd_flags . 1180.Sy syslogd_flags .
1157.It Sy timed 1181.It Sy timed
1158Boolean value. 1182Boolean value.
1159Runs 1183Runs
1160.Xr timed 8 1184.Xr timed 8
1161and passes 1185and passes
1162.Sy timed_flags . 1186.Sy timed_flags .
1163The 1187The
1164.Dq Li -M 1188.Dq Li -M
1165option allows 1189option allows
1166.Xr timed 8 1190.Xr timed 8
1167to be a master time source as well as a slave. 1191to be a master time source as well as a slave.
1168If you are also running 1192If you are also running
1169.Xr ntpd 8 , 1193.Xr ntpd 8 ,
1170only one machine running both should have the 1194only one machine running both should have the
1171.Dq Li -M 1195.Dq Li -M
1172flag given to 1196flag given to
1173.Xr timed 8 . 1197.Xr timed 8 .
1174.El 1198.El
1175.Ss Routing daemons 1199.Ss Routing daemons
1176.Bl -tag -width net_interfaces 1200.Bl -tag -width net_interfaces
1177.It Sy mrouted 1201.It Sy mrouted
1178Boolean value. 1202Boolean value.
1179Runs 1203Runs
1180.Xr mrouted 8 , 1204.Xr mrouted 8 ,
1181the DVMRP multicast routing protocol daemon. 1205the DVMRP multicast routing protocol daemon.
1182Passes 1206Passes
1183.Sy mrouted_flags . 1207.Sy mrouted_flags .
1184.It Sy route6d 1208.It Sy route6d
1185Boolean value. 1209Boolean value.
1186Runs 1210Runs
1187.Xr route6d 8 , 1211.Xr route6d 8 ,
1188the RIPng routing protocol daemon for IPv6. 1212the RIPng routing protocol daemon for IPv6.
1189Passes 1213Passes
1190.Sy route6d_flags . 1214.Sy route6d_flags .
1191.It Sy routed 1215.It Sy routed
1192Boolean value. 1216Boolean value.
1193Runs 1217Runs
1194.Xr routed 8 , 1218.Xr routed 8 ,
1195the RIP routing protocol daemon. 1219the RIP routing protocol daemon.
1196Passes 1220Passes
1197.Sy routed_flags . 1221.Sy routed_flags .
1198.\" This should be false 1222.\" This should be false
1199.\" if 1223.\" if
1200.\" .Sy gated 1224.\" .Sy gated
1201.\" is true. 1225.\" is true.
1202.It Sy rtsold 1226.It Sy rtsold
1203Boolean value. 1227Boolean value.
1204Runs 1228Runs
1205.Xr rtsold 8 , 1229.Xr rtsold 8 ,
1206the IPv6 router solicitation daemon. 1230the IPv6 router solicitation daemon.
1207.Xr rtsold 8 1231.Xr rtsold 8
1208periodically transmits router solicitation packets 1232periodically transmits router solicitation packets
1209to find IPv6 routers on the network. 1233to find IPv6 routers on the network.
1210This configuration is mainly for nomadic hosts like notebook computers. 1234This configuration is mainly for nomadic hosts like notebook computers.
1211Stationary hosts should work fine with just 1235Stationary hosts should work fine with just
1212.Sy rtsol . 1236.Sy rtsol .
1213Passes 1237Passes
1214.Sy rtsold_flags . 1238.Sy rtsold_flags .
1215This is only for autoconfigured IPv6 hosts, so set 1239This is only for autoconfigured IPv6 hosts, so set
1216.Sy ip6mode 1240.Sy ip6mode
1217to 1241to
1218.Dq Li autohost 1242.Dq Li autohost
1219if you use it. 1243if you use it.
1220.El 1244.El
1221.Ss Daemons used to boot other hosts over a network 1245.Ss Daemons used to boot other hosts over a network
1222.Bl -tag -width net_interfaces 1246.Bl -tag -width net_interfaces
1223.It Sy bootparamd 1247.It Sy bootparamd
1224Boolean value. 1248Boolean value.
1225Runs 1249Runs
1226.Xr bootparamd 8 , 1250.Xr bootparamd 8 ,
1227the boot parameter server, with 1251the boot parameter server, with
1228.Sy bootparamd_flags 1252.Sy bootparamd_flags
1229as options. 1253as options.
1230Used to boot 1254Used to boot
1231.Nx 1255.Nx
1232and 1256and
1233.Tn "SunOS 4.x" 1257.Tn "SunOS 4.x"
1234systems. 1258systems.
1235.It Sy dhcpd 1259.It Sy dhcpd
1236Boolean value. 1260Boolean value.
1237Runs 1261Runs
1238.Xr dhcpd 8 , 1262.Xr dhcpd 8 ,
1239the Dynamic Host Configuration Protocol (DHCP) daemon, 1263the Dynamic Host Configuration Protocol (DHCP) daemon,
1240for assigning IP addresses to hosts and passing boot information. 1264for assigning IP addresses to hosts and passing boot information.
1241Passes 1265Passes
1242.Sy dhcpd_flags . 1266.Sy dhcpd_flags .
1243.It Sy dhcrelay 1267.It Sy dhcrelay
1244Boolean value. 1268Boolean value.
1245Runs 1269Runs
1246.Xr dhcrelay 8 . 1270.Xr dhcrelay 8 .
1247Passes 1271Passes
1248.Sy dhcrelay_flags . 1272.Sy dhcrelay_flags .
1249.It Sy mopd 1273.It Sy mopd
1250Boolean value. 1274Boolean value.