1#!/bin/sh - 2#
| 1#!/bin/sh - 2#
|
3# $FreeBSD: head/etc/network.subr 51209 1999-09-12 17:22:08Z des $
| 3# $FreeBSD: head/etc/network.subr 51231 1999-09-13 15:44:20Z sheldonh $
|
4# From: @(#)netstart 5.9 (Berkeley) 3/30/91 5
| 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
| 6# Note that almost all of the user-configurable behavior is no longer in 7# this file, but rather in /etc/defaults/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.
| 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
| 12#
|
13network_pass1() {
| 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
| 14 echo -n 'Doing initial network setup:'
|
20
| 15
|
21 # Set the domainname if we're using NIS 22 if [ -n "${nisdomainname}" -a "${nisdomainname}" != "NO" ] ; then 23 domainname ${nisdomainname} 24 echo -n ' domain' 25 fi 26 echo '.'
| 16 # Set the host name if it is not already set 17 # 18 if [ -z "`hostname -s`" ]; then 19 hostname ${hostname} 20 echo -n ' hostname' 21 fi
|
27
| 22
|
28 # Initial ATM interface configuration 29 if [ "${atm_enable}" = "YES" -a -f /etc/rc.atm ]; then 30 . /etc/rc.atm 31 atm_pass1 32 fi
| 23 # Set the domainname if we're using NIS 24 # 25 case ${nisdomainname} in 26 [Nn][Oo] | '') 27 ;; 28 *) 29 domainname ${nisdomainname} 30 echo -n ' domain' 31 ;; 32 esac
|
33
| 33
|
34 # ISDN subsystem startup 35 if [ "${isdn_enable}" = "YES" -a -f /etc/rc.isdn ]; then 36 . /etc/rc.isdn 37 fi
| 34 echo '.'
|
38
| 35
|
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
| 36 # Initial ATM interface configuration 37 # 38 case ${atm_enable} in 39 [Yy][Ee][Ss]) 40 if [ -r /etc/rc.atm ]; then 41 . /etc/rc.atm 42 atm_pass1 43 fi 44 ;; 45 esac
|
52
| 46
|
53 # Set up all the network interfaces, calling startup scripts if needed 54 if [ "${network_interfaces}" = "auto" ]; then 55 network_interfaces="`ifconfig -l`" 56 fi 57 for ifn in ${network_interfaces}; do 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 # See if we are using DHCP 67 if [ "${ifconfig_args}" = "DHCP" ]; then 68 ${dhcp_program} ${dhcp_flags} ${ifn} 69 else 70 ifconfig ${ifn} ${ifconfig_args} 71 fi 72 showstat=true 73 fi 74 # Check to see if aliases need to be added 75 alias=0 76 while : 77 do 78 eval ifconfig_args=\$ifconfig_${ifn}_alias${alias} 79 if [ -n "${ifconfig_args}" ]; then 80 ifconfig ${ifn} ${ifconfig_args} alias 81 showstat=true 82 alias=`expr ${alias} + 1` 83 else 84 break; 85 fi 86 done 87 # Do ipx address if specified 88 eval ifconfig_args=\$ifconfig_${ifn}_ipx 89 if [ -n "${ifconfig_args}" ]; then 90 ifconfig ${ifn} ${ifconfig_args} 91 showstat=true 92 fi 93 if [ "${showstat}" = "true" ] 94 then 95 ifconfig ${ifn} 96 fi 97 done
| 47 # ISDN subsystem startup 48 # 49 case ${isdn_enable} in 50 [Yy][Ee][Ss]) 51 if [ -r /etc/rc.isdn ]; then 52 . /etc/rc.isdn 53 fi 54 ;; 55 esac
|
98
| 56
|
99 # Warm up user ppp if required, must happen before natd. 100 if [ "${ppp_enable}" = "YES" ]; then 101 # Establish ppp mode. 102 if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ 103 -a "${ppp_mode}" != "dedicated" \ 104 -a "${ppp_mode}" != "background" ]; then 105 ppp_mode="auto"; 106 fi 107 ppp_command="-${ppp_mode} ";
| 57 # Special options for sppp(4) interfaces go here. These need 58 # to go _before_ the general ifconfig section, since in the case 59 # of hardwired (no link1 flag) but required authentication, you 60 # cannot pass auth parameters down to the already running interface. 61 # 62 for ifn in ${sppp_interfaces}; do 63 eval spppcontrol_args=\$spppconfig_${ifn} 64 if [ -n "${spppcontrol_args}" ]; then 65 # The auth secrets might contain spaces; in order 66 # to retain the quotation, we need to eval them 67 # here. 68 eval spppcontrol ${ifn} ${spppcontrol_args} 69 fi 70 done
|
108
| 71
|
109 # Switch on alias mode? 110 if [ "${ppp_nat}" = "YES" ]; then 111 ppp_command="${ppp_command} -nat"; 112 fi
| 72 # Set up all the network interfaces, calling startup scripts if needed 73 # 74 case ${network_interfaces} in 75 [Aa][Uu][Tt][Oo]) 76 network_interfaces="`ifconfig -l`" 77 ;; 78 esac
|
113
| 79
|
114 echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile} 115 fi
| 80 for ifn in ${network_interfaces}; do 81 showstat=false 82 if [ -r /etc/start_if.${ifn} ]; then 83 . /etc/start_if.${ifn} 84 showstat=true 85 fi
|
116
| 86
|
117 # Initialize IP filtering using ipfw 118 echo "" 119 /sbin/ipfw -q flush > /dev/null 2>&1 120 if [ $? = 0 ] ; then 121 firewall_in_kernel=1 122 else 123 firewall_in_kernel=0 124 fi
| 87 # Do the primary ifconfig if specified 88 # 89 eval ifconfig_args=\$ifconfig_${ifn}
|
125
| 90
|
126 if [ ${firewall_in_kernel} = 0 -a "${firewall_enable}" = "YES" ] ; then 127 if kldload ipfw; then 128 firewall_in_kernel=1 # module loaded successfully 129 echo "Kernel firewall module loaded."
| 91 case ${ifconfig_args} in 92 '') 93 ;; 94 [Dd][Hh][Cc][Pp]) 95 ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn} 96 showstat=true 97 ;; 98 *) 99 ifconfig ${ifn} ${ifconfig_args} 100 showstat=true 101 ;; 102 esac 103 104 # Check to see if aliases need to be added 105 # 106 alias=0 107 while : ; do 108 eval ifconfig_args=\$ifconfig_${ifn}_alias${alias} 109 if [ -n "${ifconfig_args}" ]; then 110 ifconfig ${ifn} ${ifconfig_args} alias 111 showstat=true 112 alias=`expr ${alias} + 1` 113 else 114 break; 115 fi 116 done 117 118 # Do ipx address if specified 119 # 120 eval ifconfig_args=\$ifconfig_${ifn}_ipx 121 if [ -n "${ifconfig_args}" ]; then 122 ifconfig ${ifn} ${ifconfig_args} 123 showstat=true 124 fi 125 126 case ${showstat} in 127 true) 128 ifconfig ${ifn} 129 ;; 130 esac 131 done 132 133 # Warm up user ppp if required, must happen before natd. 134 # 135 case ${ppp_enable} in 136 [Yy][Ee][Ss]) 137 # Establish ppp mode. 138 # 139 if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ 140 -a "${ppp_mode}" != "dedicated" \ 141 -a "${ppp_mode}" != "background" ]; then 142 ppp_mode="auto"; 143 fi 144 145 ppp_command="-${ppp_mode} "; 146 147 # Switch on alias mode? 148 # 149 case ${ppp_nat} in 150 [Yy][Ee][Ss]) 151 ppp_command="${ppp_command} -nat"; 152 ;; 153 esac 154 155 echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile} 156 ;; 157 esac 158 159 # Initialize IP filtering using ipfw 160 # 161 echo '' 162 163 if /sbin/ipfw -q flush > /dev/null 2>&1; then 164 firewall_in_kernel=1
|
130 else
| 165 else
|
131 echo "Warning: firewall kernel module failed to load."
| 166 firewall_in_kernel=0
|
132 fi
| 167 fi
|
133 fi
| |
134
| 168
|
135 # Load the filters if required 136 if [ ${firewall_in_kernel} = 1 ]; then 137 if [ -z "${firewall_script}" ] ; then 138 firewall_script="/etc/rc.firewall" 139 fi 140 if [ -f ${firewall_script} -a "${firewall_enable}" = "YES" ]; then 141 . ${firewall_script} 142 echo -n 'Firewall rules loaded, starting divert daemons:'
| 169 case ${firewall_enable} in 170 [Yy][Ee][Ss]) 171 if [ "${firewall_in_kernel}" -eq 0 ] && kldload ipfw; then 172 firewall_in_kernel=1 173 echo "Kernel firewall module loaded." 174 elif [ "${firewall_in_kernel}" -eq 0 ]; then 175 echo "Warning: firewall kernel module failed to load." 176 fi 177 ;; 178 esac
|
143
| 179
|
144 # Network Address Translation daemon 145 if [ "${natd_enable}" = "YES" -a -n "${natd_interface}" ]; then 146 if echo ${natd_interface} | \ 147 grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then 148 natd_ifarg="-a ${natd_interface}" 149 else 150 natd_ifarg="-n ${natd_interface}"
| 180 # Load the filters if required 181 # 182 case ${firewall_in_kernel} in 183 1) 184 if [ -z "${firewall_script}" ]; then 185 firewall_script=/etc/rc.firewall
|
151 fi
| 186 fi
|
152 echo -n ' natd'; ${natd_program} ${natd_flags} ${natd_ifarg} 153 fi 154 echo '.' 155 else 156 IPFW_DEFAULT=`ipfw l 65535` 157 if [ "${IPFW_DEFAULT}" = "65535 deny ip from any to any" ]; then 158 echo -n "Warning: kernel has firewall functionality, " 159 echo "but firewall rules are not enabled." 160 echo " All ip services are disabled." 161 fi
| 187 188 case ${firewall_enable} in 189 [Yy][Ee][Ss]) 190 if [ -r ${firewall_script} ]; then 191 . ${firewall_script} 192 echo -n 'Firewall rules loaded, starting divert daemons:' 193 194 # Network Address Translation daemon 195 # 196 case ${natd_enable} in 197 [Yy][Ee][Ss]) 198 if [ -n "${natd_interface}" ]; then 199 if echo ${natd_interface} | \ 200 grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then 201 natd_ifarg="-a ${natd_interface}" 202 else 203 natd_ifarg="-n ${natd_interface}" 204 fi 205 206 echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg} 207 fi 208 ;; 209 esac 210 211 echo '.' 212 213 elif [ "`ipfw l 65535`" = "65535 deny ip from any to any" ]; then 214 echo -n "Warning: kernel has firewall functionality, " 215 echo "but firewall rules are not enabled." 216 echo " All ip services are disabled." 217 fi 218 ;; 219 esac 220 ;; 221 esac 222 223 # Additional ATM interface configuration 224 # 225 if [ -n "${atm_pass1_done}" ]; then 226 atm_pass2
|
162 fi
| 227 fi
|
163 fi
| |
164
| 228
|
165 # Additional ATM interface configuration 166 if [ -n "${atm_pass1_done}" ]; then 167 atm_pass2 168 fi
| 229 # Configure routing 230 # 231 case ${defaultrouter} in 232 [Nn][Oo] | '') 233 ;; 234 *) 235 static_routes="default ${static_routes}" 236 route_default="default ${defaultrouter}" 237 ;; 238 esac
|
169
| 239
|
170 # Configure routing
| 240 # Set up any static routes. This should be done before router discovery. 241 # 242 if [ -n "${static_routes}" ]; then 243 for i in ${static_routes}; do 244 eval route_args=\$route_${i} 245 route add ${route_args} 246 done 247 fi
|
171
| 248
|
172 if [ "${defaultrouter}" != "NO" ] ; then 173 static_routes="default ${static_routes}" 174 route_default="default ${defaultrouter}" 175 fi 176 177 # Set up any static routes. This should be done before router discovery. 178 if [ -n "${static_routes}" ]; then 179 for i in ${static_routes}; do 180 eval route_args=\$route_${i} 181 route add ${route_args} 182 done 183 fi
| 249 echo -n 'Additional routing options:' 250 case ${tcp_extensions} in 251 [Yy][Ee][Ss] | '') 252 ;; 253 *) 254 echo -n ' tcp extensions=NO' 255 sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 256 ;; 257 esac
|
184
| 258
|
185 echo -n 'Additional routing options:' 186 if [ -n "${tcp_extensions}" -a "${tcp_extensions}" != "YES" ] ; then 187 echo -n ' tcp extensions=NO' 188 sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 189 fi
| 259 case ${log_in_vain} in 260 [Nn][Oo] | '') 261 ;; 262 *) 263 echo -n ' log_in_vain=YES' 264 sysctl -w net.inet.tcp.log_in_vain=1 >/dev/null 265 sysctl -w net.inet.udp.log_in_vain=1 >/dev/null 266 ;; 267 esac
|
190
| 268
|
191 if [ -n "${log_in_vain}" -a "${log_in_vain}" != "NO" ] ; then 192 echo -n ' log_in_vain=YES' 193 sysctl -w net.inet.tcp.log_in_vain=1 >/dev/null 194 sysctl -w net.inet.udp.log_in_vain=1 >/dev/null 195 fi
| 269 case ${icmp_bmcastecho} in 270 [Yy][Ee][Ss]) 271 echo -n ' broadcast ping responses=YES' 272 sysctl -w net.inet.icmp.bmcastecho=1 >/dev/null 273 ;; 274 esac
|
196
| 275
|
197 if [ "${icmp_bmcastecho}" = "YES" ]; then 198 echo -n ' broadcast ping responses=YES' 199 sysctl -w net.inet.icmp.bmcastecho=1 >/dev/null 200 fi 201 202 if [ "${icmp_drop_redirect}" = "YES" ]; then 203 echo -n ' ignore ICMP redirect=YES' 204 sysctl -w net.inet.icmp.drop_redirect=1 >/dev/null 205 fi 206 207 if [ "${icmp_log_redirect}" = "YES" ]; then 208 echo -n ' log ICMP redirect=YES' 209 sysctl -w net.inet.icmp.log_redirect=1 >/dev/null 210 fi
| 276 case ${icmp_drop_redirect} in 277 [Yy][Ee][Ss]) 278 echo -n ' ignore ICMP redirect=YES' 279 sysctl -w net.inet.icmp.drop_redirect=1 >/dev/null 280 ;; 281 esac
|
211
| 282
|
212 if [ "${gateway_enable}" = "YES" ]; then 213 echo -n ' IP gateway=YES' 214 sysctl -w net.inet.ip.forwarding=1 >/dev/null 215 fi 216 217 if [ "${forward_sourceroute}" = "YES" ]; then 218 echo -n ' do source routing=YES' 219 sysctl -w net.inet.ip.sourceroute=1 >/dev/null 220 fi
| 283 case ${icmp_log_redirect} in 284 [Yy][Ee][Ss]) 285 echo -n ' log ICMP redirect=YES' 286 sysctl -w net.inet.icmp.log_redirect=1 >/dev/null 287 ;; 288 esac
|
221
| 289
|
222 if [ "${accept_sourceroute}" = "YES" ]; then 223 echo -n ' accept source routing=YES' 224 sysctl -w net.inet.ip.accept_sourceroute=1 >/dev/null 225 fi
| 290 case ${gateway_enable} in 291 [Yy][Ee][Ss]) 292 echo -n ' IP gateway=YES' 293 sysctl -w net.inet.ip.forwarding=1 >/dev/null 294 ;; 295 esac
|
226
| 296
|
227 if [ "${tcp_keepalive}" = "YES" ]; then 228 echo -n ' TCP keepalive=YES' 229 sysctl -w net.inet.tcp.always_keepalive=1 >/dev/null 230 fi
| 297 case ${forward_sourceroute} in 298 [Yy][Ee][Ss]) 299 echo -n ' do source routing=YES' 300 sysctl -w net.inet.ip.sourceroute=1 >/dev/null 301 ;; 302 esac
|
231
| 303
|
232 if [ "X$tcp_restrict_rst" = X"YES" ]; then 233 echo -n ' restrict TCP reset=YES' 234 sysctl -w net.inet.tcp.restrict_rst=1 >/dev/null 235 fi
| 304 case ${accept_sourceroute} in 305 [Yy][Ee][Ss]) 306 echo -n ' accept source routing=YES' 307 sysctl -w net.inet.ip.accept_sourceroute=1 >/dev/null 308 ;; 309 esac
|
236
| 310
|
237 if [ "X$tcp_drop_synfin" = X"YES" ]; then 238 echo -n ' drop SYN+FIN packets=YES' 239 sysctl -w net.inet.tcp.drop_synfin=1 >/dev/null 240 fi
| 311 case ${tcp_keepalive} in 312 [Yy][Ee][Ss]) 313 echo -n ' TCP keepalive=YES' 314 sysctl -w net.inet.tcp.always_keepalive=1 >/dev/null 315 ;; 316 esac
|
241
| 317
|
242 if [ "${ipxgateway_enable}" = "YES" ]; then 243 echo -n ' IPX gateway=YES' 244 sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null 245 fi 246 247 if [ "${arpproxy_all}" = "YES" ]; then 248 echo -n ' ARP proxyall=YES' 249 sysctl -w net.link.ether.inet.proxyall=1 >/dev/null 250 fi 251 echo '.'
| 318 case ${tcp_restrict_rst} in 319 [Yy][Ee][Ss]) 320 echo -n ' restrict TCP reset=YES' 321 sysctl -w net.inet.tcp.restrict_rst=1 >/dev/null 322 ;; 323 esac
|
252
| 324
|
253 echo -n 'routing daemons:' 254 if [ "${router_enable}" = "YES" ]; then 255 echo -n " ${router}"; ${router} ${router_flags} 256 fi 257 258 if [ "${ipxrouted_enable}" = "YES" ]; then 259 echo -n ' IPXrouted' 260 IPXrouted ${ipxrouted_flags} > /dev/null 2>&1 261 fi 262 263 if [ "${mrouted_enable}" = "YES" ]; then 264 echo -n ' mrouted'; mrouted ${mrouted_flags} 265 fi
| 325 case ${tcp_drop_synfin} in 326 [Yy][Ee][Ss]) 327 echo -n ' drop SYN+FIN packets=YES' 328 sysctl -w net.inet.tcp.drop_synfin=1 >/dev/null 329 ;; 330 esac
|
266
| 331
|
267 if [ "${rarpd_enable}" = "YES" ]; then 268 echo -n ' rarpd'; rarpd ${rarpd_flags} 269 fi 270 echo '.' 271 network_pass1_done=YES # Let future generations know we made it.
| 332 case ${ipxgateway_enable} in 333 [Yy][Ee][Ss]) 334 echo -n ' IPX gateway=YES' 335 sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null 336 ;; 337 esac 338 339 case ${arpproxy_all} in 340 [Yy][Ee][Ss]) 341 echo -n ' ARP proxyall=YES' 342 sysctl -w net.link.ether.inet.proxyall=1 >/dev/null 343 ;; 344 esac 345 echo '.' 346 347 echo -n 'routing daemons:' 348 case ${router_enable} in 349 [Yy][Ee][Ss]) 350 echo -n " ${router}"; ${router} ${router_flags} 351 ;; 352 esac 353 354 case ${ipxrouted_enable} in 355 [Yy][Ee][Ss]) 356 echo -n ' IPXrouted' 357 IPXrouted ${ipxrouted_flags} > /dev/null 2>&1 358 ;; 359 esac 360 361 case ${mrouted_enable} in 362 [Yy][Ee][Ss]) 363 echo -n ' mrouted'; mrouted ${mrouted_flags} 364 ;; 365 esac 366 367 case ${rarpd_enable} in 368 [Yy][Ee][Ss]) 369 echo -n ' rarpd'; rarpd ${rarpd_flags} 370 ;; 371 esac 372 echo '.' 373 374 # Let future generations know we made it. 375 # 376 network_pass1_done=YES
|
272} 273 274network_pass2() {
| 377} 378 379network_pass2() {
|
275 echo -n 'Doing additional network setup:' 276 if [ "${named_enable}" = "YES" ]; then 277 echo -n ' named'; ${named_program-"named"} ${named_flags} 278 fi
| 380 echo -n 'Doing additional network setup:' 381 case ${named_enable} in 382 [Yy][Ee][Ss]) 383 echo -n ' named'; ${named_program:-named} ${named_flags} 384 ;; 385 esac
|
279
| 386
|
280 if [ "${ntpdate_enable}" = "YES" ]; then 281 echo -n ' ntpdate'; ${ntpdate_program} ${ntpdate_flags} >/dev/null 2>&1 282 fi
| 387 case ${ntpdate_enable} in 388 [Yy][Ee][Ss]) 389 echo -n ' ntpdate' 390 ${ntpdate_program:-ntpdate} ${ntpdate_flags} >/dev/null 2>&1 391 ;; 392 esac
|
283
| 393
|
284 if [ "${xntpd_enable}" = "YES" ]; then 285 echo -n ' xntpd'; ${xntpd_program} ${xntpd_flags} 286 fi
| 394 case ${xntpd_enable} in 395 [Yy][Ee][Ss]) 396 echo -n ' xntpd'; ${xntpd_program:-xntpd} ${xntpd_flags} 397 ;; 398 esac
|
287
| 399
|
288 if [ "${timed_enable}" = "YES" ]; then 289 echo -n ' timed'; timed ${timed_flags} 290 fi
| 400 case ${timed_enable} in 401 [Yy][Ee][Ss]) 402 echo -n ' timed'; timed ${timed_flags} 403 ;; 404 esac
|
291
| 405
|
292 if [ "${portmap_enable}" = "YES" ]; then 293 echo -n ' portmap'; ${portmap_program} ${portmap_flags} 294 fi
| 406 case ${portmap_enable} in 407 [Yy][Ee][Ss]) 408 echo -n ' portmap'; ${portmap_program:-/usr/sbin/portmap} ${portmap_flags} 409 ;; 410 esac
|
295
| 411
|
296 # Start ypserv if we're an NIS server. 297 # Run rpc.ypxfrd and rpc.yppasswdd only on the NIS master server. 298 if [ "${nis_server_enable}" = "YES" ]; then 299 echo -n ' ypserv'; ypserv ${nis_server_flags} 300 301 if [ "${nis_ypxfrd_enable}" = "YES" ]; then 302 echo -n ' rpc.ypxfrd'; rpc.ypxfrd ${nis_ypxfrd_flags} 303 fi 304 305 if [ "${nis_yppasswdd_enable}" = "YES" ]; then 306 echo -n ' rpc.yppasswdd'; rpc.yppasswdd ${nis_yppasswdd_flags} 307 fi 308 fi
| 412 # Start ypserv if we're an NIS server. 413 # Run rpc.ypxfrd and rpc.yppasswdd only on the NIS master server. 414 # 415 case ${nis_server_enable} in 416 [Yy][Ee][Ss]) 417 echo -n ' ypserv'; ypserv ${nis_server_flags}
|
309
| 418
|
310 # Start ypbind if we're an NIS client 311 if [ "${nis_client_enable}" = "YES" ]; then 312 echo -n ' ypbind'; ypbind ${nis_client_flags} 313 if [ "${nis_ypset_enable}" = "YES" ]; then 314 echo -n ' ypset'; ypset ${nis_ypset_flags} 315 fi 316 fi
| 419 case ${nis_ypxfrd_enable} in 420 [Yy][Ee][Ss]) 421 echo -n ' rpc.ypxfrd' 422 rpc.ypxfrd ${nis_ypxfrd_flags} 423 ;; 424 esac
|
317
| 425
|
318 # Start keyserv if we are running Secure RPC 319 if [ "${keyserv_enable}" = "YES" ]; then 320 echo -n ' keyserv'; keyserv ${keyserv_flags} 321 fi 322 # Start ypupdated if we are running Secure RPC and we are NIS master 323 if [ "${rpc_ypupdated_enable}" = "YES" ]; then 324 echo -n ' rpc.ypupdated'; rpc.ypupdated 325 fi
| 426 case ${nis_yppasswdd_enable} in 427 [Yy][Ee][Ss]) 428 echo -n ' rpc.yppasswdd' 429 rpc.yppasswdd ${nis_yppasswdd_flags} 430 ;; 431 esac 432 ;; 433 esac
|
326
| 434
|
327 # Start ATM daemons 328 if [ -n "${atm_pass2_done}" ]; then 329 atm_pass3 330 fi
| 435 # Start ypbind if we're an NIS client 436 # 437 case ${nis_client_enable} in 438 [Yy][Ee][Ss]) 439 echo -n ' ypbind'; ypbind ${nis_client_flags} 440 case ${nis_ypset_enable} in 441 [Yy][Ee][Ss]) 442 echo -n ' ypset'; ypset ${nis_ypset_flags} 443 ;; 444 esac 445 ;; 446 esac
|
331
| 447
|
332 echo '.' 333 network_pass2_done=YES
| 448 # Start keyserv if we are running Secure RPC 449 # 450 case ${keyserv_enable} in 451 [Yy][Ee][Ss]) 452 echo -n ' keyserv'; keyserv ${keyserv_flags} 453 ;; 454 esac 455 456 # Start ypupdated if we are running Secure RPC and we are NIS master 457 # 458 case ${rpc_ypupdated_enable} in 459 [Yy][Ee][Ss]) 460 echo -n ' rpc.ypupdated'; rpc.ypupdated 461 ;; 462 esac 463 464 # Start ATM daemons 465 if [ -n "${atm_pass2_done}" ]; then 466 atm_pass3 467 fi 468 469 echo '.' 470 network_pass2_done=YES
|
334} 335 336network_pass3() {
| 471} 472 473network_pass3() {
|
337 echo -n 'Starting final network daemons:'
| 474 echo -n 'Starting final network daemons:'
|
338
| 475
|
339 if [ "${nfs_server_enable}" = "YES" -a -r /etc/exports ]; then 340 echo -n ' mountd' 341 if [ "${weak_mountd_authentication}" = "YES" ]; then 342 mountd_flags="-n" 343 fi 344 mountd ${mountd_flags} 345 if [ "${nfs_reserved_port_only}" = "YES" ]; then 346 echo -n ' NFS on reserved port only=YES' 347 sysctl -w vfs.nfs.nfs_privport=1 >/dev/null 348 fi 349 echo -n ' nfsd'; nfsd ${nfs_server_flags} 350 if [ "${rpc_lockd_enable}" = "YES" ]; then 351 echo -n ' rpc.lockd'; rpc.lockd 352 fi 353 if [ "${rpc_statd_enable}" = "YES" ]; then 354 echo -n ' rpc.statd'; rpc.statd 355 fi 356 fi 357 358 if [ "${nfs_client_enable}" = "YES" ]; then 359 echo -n ' nfsiod'; nfsiod ${nfs_client_flags} 360 if [ "${nfs_access_cache}" != "X" ]; then
| 476 case ${nfs_server_enable} in 477 [Yy][Ee][Ss]) 478 if [ -r /etc/exports ]; then 479 echo -n ' mountd' 480 481 case ${weak_mountd_authentication} in 482 [Yy][Ee][Ss]) 483 mountd_flags="-n" 484 ;; 485 esac 486 487 mountd ${mountd_flags} 488 489 case ${nfs_reserved_port_only} in 490 [Yy][Ee][Ss]) 491 echo -n ' NFS on reserved port only=YES' 492 sysctl -w vfs.nfs.nfs_privport=1 >/dev/null 493 ;; 494 esac 495 496 echo -n ' nfsd'; nfsd ${nfs_server_flags} 497 498 case ${rpc_lockd_enable} in 499 [Yy][Ee][Ss]) 500 echo -n ' rpc.lockd'; rpc.lockd 501 ;; 502 esac 503 504 case ${rpc_statd_enable} in 505 [Yy][Ee][Ss]) 506 echo -n ' rpc.statd'; rpc.statd 507 ;; 508 esac 509 fi 510 ;; 511 esac 512 513 case ${nfs_client_enable} in 514 [Yy][Ee][Ss]) 515 echo -n ' nfsiod'; nfsiod ${nfs_client_flags} 516 if [ -n "${nfs_access_cache}" ]; then
|
361 echo -n " NFS access cache time=${nfs_access_cache}" 362 sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} \
| 517 echo -n " NFS access cache time=${nfs_access_cache}" 518 sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} \
|
363 >/dev/null 364 fi 365 fi
| 519 >/dev/null 520 fi 521 ;; 522 esac
|
366
| 523
|
367 if [ "${amd_enable}" = "YES" ]; then 368 echo -n ' amd' 369 if [ "${amd_map_program}" != "NO" ]; then 370 amd_flags="${amd_flags} `eval ${amd_map_program}`" 371 fi 372 if [ -n "${amd_flags}" ] 373 then 374 amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null 375 else 376 amd 2> /dev/null 377 fi 378 fi
| 524 case ${amd_enable} in 525 [Yy][Ee][Ss]) 526 echo -n ' amd' 527 case ${amd_map_program} in 528 [Nn][Oo] | '') 529 ;; 530 *) 531 amd_flags="${amd_flags} `eval ${amd_map_program}`" 532 ;; 533 esac
|
379
| 534
|
380 if [ "${rwhod_enable}" = "YES" ]; then 381 echo -n ' rwhod'; rwhod ${rwhod_flags} 382 fi
| 535 if [ -n "${amd_flags}" ]; then 536 amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null 537 else 538 amd 2> /dev/null 539 fi 540 ;; 541 esac
|
383
| 542
|
384 # Kerberos runs ONLY on the Kerberos server machine 385 if [ "${kerberos_server_enable}" = "YES" ]; then 386 if [ "${kerberos_stash}" = "YES" ]; then 387 stash_flag=-n 388 else 389 stash_flag= 390 fi 391 echo -n ' kerberos'; \
| 543 case ${rwhod_enable} in 544 [Yy][Ee][Ss]) 545 echo -n ' rwhod'; rwhod ${rwhod_flags} 546 ;; 547 esac 548 549 # Kerberos runs ONLY on the Kerberos server machine 550 case ${kerberos_server_enable} in 551 [Yy][Ee][Ss]) 552 case ${kerberos_stash} in 553 [Yy][Ee][Ss]) 554 stash_flag=-n 555 ;; 556 *) 557 stash_flag= 558 ;; 559 esac 560 561 echo -n ' kerberos'
|
392 kerberos ${stash_flag} >> /var/log/kerberos.log &
| 562 kerberos ${stash_flag} >> /var/log/kerberos.log &
|
393 if [ "${kadmind_server_enable}" = "YES" ]; then 394 echo -n ' kadmind'; \ 395 (sleep 20; kadmind ${stash_flag} >/dev/null 2>&1 &) & 396 fi 397 unset stash_flag 398 fi 399 400 echo '.' 401 network_pass3_done=YES
| 563 564 case ${kadmind_server_enable} in 565 [Yy][Ee][Ss]) 566 echo -n ' kadmind' 567 (sleep 20; kadmind ${stash_flag} >/dev/null 2>&1 &) & 568 ;; 569 esac 570 unset stash_flag 571 ;; 572 esac 573 574 echo '.' 575 network_pass3_done=YES
|
402}
| 576}
|