Deleted Added
full compact
netoptions (48662) netoptions (48687)
1#!/bin/sh -
2#
1#!/bin/sh -
2#
3# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
3# $Id: rc.network,v 1.48 1999/07/07 12:49:45 peter Exp $
4# From: @(#)netstart 5.9 (Berkeley) 3/30/91
5
6# Note that almost all the user-configurable behavior is no longer in
7# this file, but rather in /etc/rc.conf. Please check that file
8# first before contemplating any changes here. If you do need to change
9# this file for some reason, we would like to know about it.
10
11# First pass startup stuff.
12
13network_pass1() {
14 echo -n 'Doing initial network setup:'
15 # Set the host name if it is not already set
16 if [ -z "`hostname -s`" ] ; then
17 hostname $hostname
18 echo -n ' hostname'
19 fi
20
21 # Set the domainname if we're using NIS
22 if [ -n "$nisdomainname" -a "x$nisdomainname" != "xNO" ] ; then
23 domainname $nisdomainname
24 echo -n ' domain'
25 fi
26 echo '.'
27
28 # Initial ATM interface configuration
29 if [ "X${atm_enable}" = X"YES" -a -f /etc/rc.atm ]; then
30 . /etc/rc.atm
31 atm_pass1
32 fi
33
34 # ISDN subsystem startup
35 if [ "X${isdn_enable}" = X"YES" -a -f /etc/rc.isdn ]; then
36 . /etc/rc.isdn
37 fi
38
39 # Special options for sppp(4) interfaces go here. These need
40 # to go _before_ the general ifconfig section, since in the case
41 # of hardwired (no link1 flag) but required authentication, you
42 # cannot pass auth parameters down to the already running interface.
43 for ifn in ${sppp_interfaces}; do
44 eval spppcontrol_args=\$spppconfig_${ifn}
45 if [ -n "${spppcontrol_args}" ] ; then
46 # The auth secrets might contain spaces; in order
47 # to retain the quotation, we need to eval them
48 # here.
49 eval spppcontrol ${ifn} ${spppcontrol_args}
50 fi
51 done
52
53 # Set up all the network interfaces, calling startup scripts if needed
4# From: @(#)netstart 5.9 (Berkeley) 3/30/91
5
6# Note that almost all the user-configurable behavior is no longer in
7# this file, but rather in /etc/rc.conf. Please check that file
8# first before contemplating any changes here. If you do need to change
9# this file for some reason, we would like to know about it.
10
11# First pass startup stuff.
12
13network_pass1() {
14 echo -n 'Doing initial network setup:'
15 # Set the host name if it is not already set
16 if [ -z "`hostname -s`" ] ; then
17 hostname $hostname
18 echo -n ' hostname'
19 fi
20
21 # Set the domainname if we're using NIS
22 if [ -n "$nisdomainname" -a "x$nisdomainname" != "xNO" ] ; then
23 domainname $nisdomainname
24 echo -n ' domain'
25 fi
26 echo '.'
27
28 # Initial ATM interface configuration
29 if [ "X${atm_enable}" = X"YES" -a -f /etc/rc.atm ]; then
30 . /etc/rc.atm
31 atm_pass1
32 fi
33
34 # ISDN subsystem startup
35 if [ "X${isdn_enable}" = X"YES" -a -f /etc/rc.isdn ]; then
36 . /etc/rc.isdn
37 fi
38
39 # Special options for sppp(4) interfaces go here. These need
40 # to go _before_ the general ifconfig section, since in the case
41 # of hardwired (no link1 flag) but required authentication, you
42 # cannot pass auth parameters down to the already running interface.
43 for ifn in ${sppp_interfaces}; do
44 eval spppcontrol_args=\$spppconfig_${ifn}
45 if [ -n "${spppcontrol_args}" ] ; then
46 # The auth secrets might contain spaces; in order
47 # to retain the quotation, we need to eval them
48 # here.
49 eval spppcontrol ${ifn} ${spppcontrol_args}
50 fi
51 done
52
53 # Set up all the network interfaces, calling startup scripts if needed
54 interfaces="`ifconfig -l`"
55 for ifn in ${interfaces}; do
54 if [ "x${network_interfaces}" = "xauto" ]; then
55 network_interfaces="`ifconfig -l`"
56 fi
57 for ifn in ${network_interfaces}; do
56 showstat=false
57 if [ -e /etc/start_if.${ifn} ]; then
58 . /etc/start_if.${ifn}
59 showstat=true
60 fi
61 # Do the primary ifconfig if specified
62 eval ifconfig_args=\$ifconfig_${ifn}
63 if [ -n "${ifconfig_args}" ] ; then
64 ifconfig ${ifn} ${ifconfig_args}
65 showstat=true
66 fi
67 # Check to see if aliases need to be added
68 alias=0
69 while :
70 do
71 eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
72 if [ -n "${ifconfig_args}" ]; then
73 ifconfig ${ifn} ${ifconfig_args} alias
74 showstat=true
75 alias=`expr ${alias} + 1`
76 else
77 break;
78 fi
79 done
80 # Do ipx address if specified
81 eval ifconfig_args=\$ifconfig_${ifn}_ipx
82 if [ -n "${ifconfig_args}" ]; then
83 ifconfig ${ifn} ${ifconfig_args}
84 showstat=true
85 fi
86 if [ "${showstat}" = "true" ]
87 then
88 ifconfig ${ifn}
89 fi
90 done
91
92 # Initialize IP filtering using ipfw
93 echo ""
94 /sbin/ipfw -q flush > /dev/null 2>&1
95 if [ $? = 0 ] ; then
96 firewall_in_kernel=1
97 else
98 firewall_in_kernel=0
99 fi
100
101 if [ $firewall_in_kernel = 0 -a "x$firewall_enable" = "xYES" ] ; then
102 if kldload ipfw; then
103 firewall_in_kernel=1 # module loaded successfully
104 echo "Kernel firewall module loaded."
105 else
106 echo "Warning: firewall kernel module failed to load."
107 fi
108 fi
109
110 # Load the filters if required
111 if [ $firewall_in_kernel = 1 ]; then
112 if [ -z "${firewall_script}" ] ; then
113 firewall_script="/etc/rc.firewall"
114 fi
115 if [ -f ${firewall_script} -a X"$firewall_enable" = X"YES" ]; then
116 . ${firewall_script}
117 echo -n 'Firewall rules loaded, starting divert daemons:'
118
119 # Network Address Translation daemon
120 if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then
121 if echo ${natd_interface} | \
122 grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then
123 natd_ifarg="-a ${natd_interface}"
124 else
125 natd_ifarg="-n ${natd_interface}"
126 fi
127 echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg}
128 fi
129 echo '.'
130 else
131 IPFW_DEFAULT=`ipfw l 65535`
132 if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
133 echo -n "Warning: kernel has firewall functionality, "
134 echo "but firewall rules are not enabled."
135 echo " All ip services are disabled."
136 fi
137 fi
138 fi
139
140 # Additional ATM interface configuration
141 if [ -n "${atm_pass1_done}" ]; then
142 atm_pass2
143 fi
144
145 # Configure routing
146
147 if [ "x$defaultrouter" != "xNO" ] ; then
148 static_routes="default ${static_routes}"
149 route_default="default ${defaultrouter}"
150 fi
151
152 # Set up any static routes. This should be done before router discovery.
153 if [ "x${static_routes}" != "x" ]; then
154 for i in ${static_routes}; do
155 eval route_args=\$route_${i}
156 route add ${route_args}
157 done
158 fi
159
160 echo -n 'Additional routing options:'
161 if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then
162 echo -n ' tcp extensions=NO'
163 sysctl -w net.inet.tcp.rfc1323=0 >/dev/null
164 fi
165
166 if [ -n "$log_in_vain" -a "x$log_in_vain" != "xNO" ] ; then
167 echo -n ' log_in_vain=YES'
168 sysctl -w net.inet.tcp.log_in_vain=1 >/dev/null
169 sysctl -w net.inet.udp.log_in_vain=1 >/dev/null
170 fi
171
172 if [ X"$icmp_bmcastecho" = X"YES" ]; then
173 echo -n ' broadcast ping responses=YES'
174 sysctl -w net.inet.icmp.bmcastecho=1 >/dev/null
175 fi
176
177 if [ "X$gateway_enable" = X"YES" ]; then
178 echo -n ' IP gateway=YES'
179 sysctl -w net.inet.ip.forwarding=1 >/dev/null
180 fi
181
182 if [ "X$forward_sourceroute" = X"YES" ]; then
183 echo -n ' do source routing=YES'
184 sysctl -w net.inet.ip.sourceroute=1 >/dev/null
185 fi
186
187 if [ "X$accept_sourceroute" = X"YES" ]; then
188 echo -n ' accept source routing=YES'
189 sysctl -w net.inet.ip.accept_sourceroute=1 >/dev/null
190 fi
191
192 if [ "X$tcp_keepalive" = X"YES" ]; then
193 echo -n ' TCP keepalive=YES'
194 sysctl -w net.inet.tcp.always_keepalive=1 >/dev/null
195 fi
196
197 if [ "X$ipxgateway_enable" = X"YES" ]; then
198 echo -n ' IPX gateway=YES'
199 sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null
200 fi
201
202 if [ "X$arpproxy_all" = X"YES" ]; then
203 echo -n ' ARP proxyall=YES'
204 sysctl -w net.link.ether.inet.proxyall=1 >/dev/null
205 fi
206 echo '.'
207
208 echo -n 'routing daemons:'
209 if [ "X$router_enable" = X"YES" ]; then
210 echo -n " ${router}"; ${router} ${router_flags}
211 fi
212
213 if [ "X$ipxrouted_enable" = X"YES" ]; then
214 echo -n ' IPXrouted'
215 IPXrouted ${ipxrouted_flags} > /dev/null 2>&1
216 fi
217
218 if [ "X${mrouted_enable}" = X"YES" ]; then
219 echo -n ' mrouted'; mrouted ${mrouted_flags}
220 fi
221
222 if [ "X$rarpd_enable" = X"YES" ]; then
223 echo -n ' rarpd'; rarpd ${rarpd_flags}
224 fi
225 echo '.'
226 network_pass1_done=YES # Let future generations know we made it.
227}
228
229network_pass2() {
230 echo -n 'Doing additional network setup:'
231 if [ "X${named_enable}" = X"YES" ]; then
232 echo -n ' named'; ${named_program-"named"} ${named_flags}
233 fi
234
235 if [ "X${ntpdate_enable}" = X"YES" ]; then
236 echo -n ' ntpdate'; ${ntpdate_program} ${ntpdate_flags} >/dev/null 2>&1
237 fi
238
239 if [ "X${xntpd_enable}" = X"YES" ]; then
240 echo -n ' xntpd'; ${xntpd_program} ${xntpd_flags}
241 fi
242
243 if [ "X${timed_enable}" = X"YES" ]; then
244 echo -n ' timed'; timed ${timed_flags}
245 fi
246
247 if [ "X${portmap_enable}" = X"YES" ]; then
248 echo -n ' portmap'; ${portmap_program} ${portmap_flags}
249 fi
250
251 # Start ypserv if we're an NIS server.
252 # Run rpc.ypxfrd and rpc.yppasswdd only on the NIS master server.
253 if [ "X${nis_server_enable}" = X"YES" ]; then
254 echo -n ' ypserv'; ypserv ${nis_server_flags}
255
256 if [ "X${nis_ypxfrd_enable}" = X"YES" ]; then
257 echo -n ' rpc.ypxfrd'; rpc.ypxfrd ${nis_ypxfrd_flags}
258 fi
259
260 if [ "X${nis_yppasswdd_enable}" = X"YES" ]; then
261 echo -n ' rpc.yppasswdd'; rpc.yppasswdd ${nis_yppasswdd_flags}
262 fi
263 fi
264
265 # Start ypbind if we're an NIS client
266 if [ "X${nis_client_enable}" = X"YES" ]; then
267 echo -n ' ypbind'; ypbind ${nis_client_flags}
268 if [ "X${nis_ypset_enable}" = X"YES" ]; then
269 echo -n ' ypset'; ypset ${nis_ypset_flags}
270 fi
271 fi
272
273 # Start keyserv if we are running Secure RPC
274 if [ "X${keyserv_enable}" = X"YES" ]; then
275 echo -n ' keyserv'; keyserv ${keyserv_flags}
276 fi
277 # Start ypupdated if we are running Secure RPC and we are NIS master
278 if [ "X$rpc_ypupdated_enable" = X"YES" ]; then
279 echo -n ' rpc.ypupdated'; rpc.ypupdated
280 fi
281
282 # Start ATM daemons
283 if [ -n "${atm_pass2_done}" ]; then
284 atm_pass3
285 fi
286
287 echo '.'
288 network_pass2_done=YES
289}
290
291network_pass3() {
292 echo -n 'Starting final network daemons:'
293
294 if [ "X${nfs_server_enable}" = X"YES" -a -r /etc/exports ]; then
295 echo -n ' mountd'
296 if [ "X${weak_mountd_authentication}" = X"YES" ]; then
297 mountd_flags="-n"
298 fi
299 mountd ${mountd_flags}
300 if [ "X${nfs_reserved_port_only}" = X"YES" ]; then
301 echo -n ' NFS on reserved port only=YES'
302 sysctl -w vfs.nfs.nfs_privport=1 >/dev/null
303 fi
304 echo -n ' nfsd'; nfsd ${nfs_server_flags}
305 if [ "X$rpc_lockd_enable" = X"YES" ]; then
306 echo -n ' rpc.lockd'; rpc.lockd
307 fi
308 if [ "X$rpc_statd_enable" = X"YES" ]; then
309 echo -n ' rpc.statd'; rpc.statd
310 fi
311 fi
312
313 if [ "X${nfs_client_enable}" = X"YES" ]; then
314 echo -n ' nfsiod'; nfsiod ${nfs_client_flags}
315 if [ "X${nfs_access_cache}" != X ]; then
316 echo -n " NFS access cache time=${nfs_access_cache}"
317 sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} \
318 >/dev/null
319 fi
320 fi
321
322 if [ "X${amd_enable}" = X"YES" ]; then
323 echo -n ' amd'
324 if [ "X${amd_map_program}" != X"NO" ]; then
325 amd_flags="${amd_flags} `eval ${amd_map_program}`"
326 fi
327 if [ -n "$amd_flags" ]
328 then
329 amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
330 else
331 amd 2> /dev/null
332 fi
333 fi
334
335 if [ "X${rwhod_enable}" = X"YES" ]; then
336 echo -n ' rwhod'; rwhod ${rwhod_flags}
337 fi
338
339 # Kerberos runs ONLY on the Kerberos server machine
340 if [ "X${kerberos_server_enable}" = X"YES" ]; then
341 if [ "X${kerberos_stash}" = "XYES" ]; then
342 stash_flag=-n
343 else
344 stash_flag=
345 fi
346 echo -n ' kerberos'; \
347 kerberos ${stash_flag} >> /var/log/kerberos.log &
348 if [ "X${kadmind_server_enable}" = "XYES" ]; then
349 echo -n ' kadmind'; \
350 (sleep 20; kadmind ${stash_flag} >/dev/null 2>&1 &) &
351 fi
352 unset stash_flag
353 fi
354
355 echo '.'
356 network_pass3_done=YES
357}
58 showstat=false
59 if [ -e /etc/start_if.${ifn} ]; then
60 . /etc/start_if.${ifn}
61 showstat=true
62 fi
63 # Do the primary ifconfig if specified
64 eval ifconfig_args=\$ifconfig_${ifn}
65 if [ -n "${ifconfig_args}" ] ; then
66 ifconfig ${ifn} ${ifconfig_args}
67 showstat=true
68 fi
69 # Check to see if aliases need to be added
70 alias=0
71 while :
72 do
73 eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
74 if [ -n "${ifconfig_args}" ]; then
75 ifconfig ${ifn} ${ifconfig_args} alias
76 showstat=true
77 alias=`expr ${alias} + 1`
78 else
79 break;
80 fi
81 done
82 # Do ipx address if specified
83 eval ifconfig_args=\$ifconfig_${ifn}_ipx
84 if [ -n "${ifconfig_args}" ]; then
85 ifconfig ${ifn} ${ifconfig_args}
86 showstat=true
87 fi
88 if [ "${showstat}" = "true" ]
89 then
90 ifconfig ${ifn}
91 fi
92 done
93
94 # Initialize IP filtering using ipfw
95 echo ""
96 /sbin/ipfw -q flush > /dev/null 2>&1
97 if [ $? = 0 ] ; then
98 firewall_in_kernel=1
99 else
100 firewall_in_kernel=0
101 fi
102
103 if [ $firewall_in_kernel = 0 -a "x$firewall_enable" = "xYES" ] ; then
104 if kldload ipfw; then
105 firewall_in_kernel=1 # module loaded successfully
106 echo "Kernel firewall module loaded."
107 else
108 echo "Warning: firewall kernel module failed to load."
109 fi
110 fi
111
112 # Load the filters if required
113 if [ $firewall_in_kernel = 1 ]; then
114 if [ -z "${firewall_script}" ] ; then
115 firewall_script="/etc/rc.firewall"
116 fi
117 if [ -f ${firewall_script} -a X"$firewall_enable" = X"YES" ]; then
118 . ${firewall_script}
119 echo -n 'Firewall rules loaded, starting divert daemons:'
120
121 # Network Address Translation daemon
122 if [ X"${natd_enable}" = X"YES" -a -n "${natd_interface}" ]; then
123 if echo ${natd_interface} | \
124 grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then
125 natd_ifarg="-a ${natd_interface}"
126 else
127 natd_ifarg="-n ${natd_interface}"
128 fi
129 echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg}
130 fi
131 echo '.'
132 else
133 IPFW_DEFAULT=`ipfw l 65535`
134 if [ "$IPFW_DEFAULT" = "65535 deny ip from any to any" ]; then
135 echo -n "Warning: kernel has firewall functionality, "
136 echo "but firewall rules are not enabled."
137 echo " All ip services are disabled."
138 fi
139 fi
140 fi
141
142 # Additional ATM interface configuration
143 if [ -n "${atm_pass1_done}" ]; then
144 atm_pass2
145 fi
146
147 # Configure routing
148
149 if [ "x$defaultrouter" != "xNO" ] ; then
150 static_routes="default ${static_routes}"
151 route_default="default ${defaultrouter}"
152 fi
153
154 # Set up any static routes. This should be done before router discovery.
155 if [ "x${static_routes}" != "x" ]; then
156 for i in ${static_routes}; do
157 eval route_args=\$route_${i}
158 route add ${route_args}
159 done
160 fi
161
162 echo -n 'Additional routing options:'
163 if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then
164 echo -n ' tcp extensions=NO'
165 sysctl -w net.inet.tcp.rfc1323=0 >/dev/null
166 fi
167
168 if [ -n "$log_in_vain" -a "x$log_in_vain" != "xNO" ] ; then
169 echo -n ' log_in_vain=YES'
170 sysctl -w net.inet.tcp.log_in_vain=1 >/dev/null
171 sysctl -w net.inet.udp.log_in_vain=1 >/dev/null
172 fi
173
174 if [ X"$icmp_bmcastecho" = X"YES" ]; then
175 echo -n ' broadcast ping responses=YES'
176 sysctl -w net.inet.icmp.bmcastecho=1 >/dev/null
177 fi
178
179 if [ "X$gateway_enable" = X"YES" ]; then
180 echo -n ' IP gateway=YES'
181 sysctl -w net.inet.ip.forwarding=1 >/dev/null
182 fi
183
184 if [ "X$forward_sourceroute" = X"YES" ]; then
185 echo -n ' do source routing=YES'
186 sysctl -w net.inet.ip.sourceroute=1 >/dev/null
187 fi
188
189 if [ "X$accept_sourceroute" = X"YES" ]; then
190 echo -n ' accept source routing=YES'
191 sysctl -w net.inet.ip.accept_sourceroute=1 >/dev/null
192 fi
193
194 if [ "X$tcp_keepalive" = X"YES" ]; then
195 echo -n ' TCP keepalive=YES'
196 sysctl -w net.inet.tcp.always_keepalive=1 >/dev/null
197 fi
198
199 if [ "X$ipxgateway_enable" = X"YES" ]; then
200 echo -n ' IPX gateway=YES'
201 sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null
202 fi
203
204 if [ "X$arpproxy_all" = X"YES" ]; then
205 echo -n ' ARP proxyall=YES'
206 sysctl -w net.link.ether.inet.proxyall=1 >/dev/null
207 fi
208 echo '.'
209
210 echo -n 'routing daemons:'
211 if [ "X$router_enable" = X"YES" ]; then
212 echo -n " ${router}"; ${router} ${router_flags}
213 fi
214
215 if [ "X$ipxrouted_enable" = X"YES" ]; then
216 echo -n ' IPXrouted'
217 IPXrouted ${ipxrouted_flags} > /dev/null 2>&1
218 fi
219
220 if [ "X${mrouted_enable}" = X"YES" ]; then
221 echo -n ' mrouted'; mrouted ${mrouted_flags}
222 fi
223
224 if [ "X$rarpd_enable" = X"YES" ]; then
225 echo -n ' rarpd'; rarpd ${rarpd_flags}
226 fi
227 echo '.'
228 network_pass1_done=YES # Let future generations know we made it.
229}
230
231network_pass2() {
232 echo -n 'Doing additional network setup:'
233 if [ "X${named_enable}" = X"YES" ]; then
234 echo -n ' named'; ${named_program-"named"} ${named_flags}
235 fi
236
237 if [ "X${ntpdate_enable}" = X"YES" ]; then
238 echo -n ' ntpdate'; ${ntpdate_program} ${ntpdate_flags} >/dev/null 2>&1
239 fi
240
241 if [ "X${xntpd_enable}" = X"YES" ]; then
242 echo -n ' xntpd'; ${xntpd_program} ${xntpd_flags}
243 fi
244
245 if [ "X${timed_enable}" = X"YES" ]; then
246 echo -n ' timed'; timed ${timed_flags}
247 fi
248
249 if [ "X${portmap_enable}" = X"YES" ]; then
250 echo -n ' portmap'; ${portmap_program} ${portmap_flags}
251 fi
252
253 # Start ypserv if we're an NIS server.
254 # Run rpc.ypxfrd and rpc.yppasswdd only on the NIS master server.
255 if [ "X${nis_server_enable}" = X"YES" ]; then
256 echo -n ' ypserv'; ypserv ${nis_server_flags}
257
258 if [ "X${nis_ypxfrd_enable}" = X"YES" ]; then
259 echo -n ' rpc.ypxfrd'; rpc.ypxfrd ${nis_ypxfrd_flags}
260 fi
261
262 if [ "X${nis_yppasswdd_enable}" = X"YES" ]; then
263 echo -n ' rpc.yppasswdd'; rpc.yppasswdd ${nis_yppasswdd_flags}
264 fi
265 fi
266
267 # Start ypbind if we're an NIS client
268 if [ "X${nis_client_enable}" = X"YES" ]; then
269 echo -n ' ypbind'; ypbind ${nis_client_flags}
270 if [ "X${nis_ypset_enable}" = X"YES" ]; then
271 echo -n ' ypset'; ypset ${nis_ypset_flags}
272 fi
273 fi
274
275 # Start keyserv if we are running Secure RPC
276 if [ "X${keyserv_enable}" = X"YES" ]; then
277 echo -n ' keyserv'; keyserv ${keyserv_flags}
278 fi
279 # Start ypupdated if we are running Secure RPC and we are NIS master
280 if [ "X$rpc_ypupdated_enable" = X"YES" ]; then
281 echo -n ' rpc.ypupdated'; rpc.ypupdated
282 fi
283
284 # Start ATM daemons
285 if [ -n "${atm_pass2_done}" ]; then
286 atm_pass3
287 fi
288
289 echo '.'
290 network_pass2_done=YES
291}
292
293network_pass3() {
294 echo -n 'Starting final network daemons:'
295
296 if [ "X${nfs_server_enable}" = X"YES" -a -r /etc/exports ]; then
297 echo -n ' mountd'
298 if [ "X${weak_mountd_authentication}" = X"YES" ]; then
299 mountd_flags="-n"
300 fi
301 mountd ${mountd_flags}
302 if [ "X${nfs_reserved_port_only}" = X"YES" ]; then
303 echo -n ' NFS on reserved port only=YES'
304 sysctl -w vfs.nfs.nfs_privport=1 >/dev/null
305 fi
306 echo -n ' nfsd'; nfsd ${nfs_server_flags}
307 if [ "X$rpc_lockd_enable" = X"YES" ]; then
308 echo -n ' rpc.lockd'; rpc.lockd
309 fi
310 if [ "X$rpc_statd_enable" = X"YES" ]; then
311 echo -n ' rpc.statd'; rpc.statd
312 fi
313 fi
314
315 if [ "X${nfs_client_enable}" = X"YES" ]; then
316 echo -n ' nfsiod'; nfsiod ${nfs_client_flags}
317 if [ "X${nfs_access_cache}" != X ]; then
318 echo -n " NFS access cache time=${nfs_access_cache}"
319 sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} \
320 >/dev/null
321 fi
322 fi
323
324 if [ "X${amd_enable}" = X"YES" ]; then
325 echo -n ' amd'
326 if [ "X${amd_map_program}" != X"NO" ]; then
327 amd_flags="${amd_flags} `eval ${amd_map_program}`"
328 fi
329 if [ -n "$amd_flags" ]
330 then
331 amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
332 else
333 amd 2> /dev/null
334 fi
335 fi
336
337 if [ "X${rwhod_enable}" = X"YES" ]; then
338 echo -n ' rwhod'; rwhod ${rwhod_flags}
339 fi
340
341 # Kerberos runs ONLY on the Kerberos server machine
342 if [ "X${kerberos_server_enable}" = X"YES" ]; then
343 if [ "X${kerberos_stash}" = "XYES" ]; then
344 stash_flag=-n
345 else
346 stash_flag=
347 fi
348 echo -n ' kerberos'; \
349 kerberos ${stash_flag} >> /var/log/kerberos.log &
350 if [ "X${kadmind_server_enable}" = "XYES" ]; then
351 echo -n ' kadmind'; \
352 (sleep 20; kadmind ${stash_flag} >/dev/null 2>&1 &) &
353 fi
354 unset stash_flag
355 fi
356
357 echo '.'
358 network_pass3_done=YES
359}