Annotation of src/etc/rc, Revision 1.373
1.373 ! deraadt 1: # $OpenBSD: rc,v 1.372 2011/07/08 00:54:04 ajacoutot Exp $
1.1 deraadt 2:
3: # System startup script run by init on autoboot
4: # or after single-user.
5: # Output and error are redirected to console by init,
6: # and the console is the controlling terminal.
7:
1.131 millert 8: # Subroutines (have to come first).
9:
10: # Strip comments (and leading/trailing whitespace if IFS is set)
11: # from a file and spew to stdout
12: stripcom() {
13: local _file="$1"
14: local _line
15:
16: {
17: while read _line ; do
18: _line=${_line%%#*} # strip comments
19: test -z "$_line" && continue
20: echo $_line
21: done
22: } < $_file
23: }
24:
1.265 millert 25: # Update resource limits when sysctl changes
26: # Usage: update_limit -X loginconf_name
27: update_limit() {
28: local _fl="$1" # ulimit flag
29: local _lc="$2" # login.conf name
30: local _new _suf
31:
32: for _suf in "" -cur -max; do
33: _new=`getcap -f /etc/login.conf -s ${_lc}${_suf} daemon 2>/dev/null`
34: if [ X"$_new" != X"" ]; then
35: if [ X"$_new" = X"infinity" ]; then
36: _new=unlimited
37: fi
38: case "$_suf" in
39: -cur)
40: ulimit -S $_fl $_new
41: ;;
42: -max)
43: ulimit -H $_fl $_new
44: ;;
45: *)
46: ulimit $_fl $_new
47: return
48: ;;
49: esac
50: fi
51: done
52: }
53:
54: sysctl_conf() {
1.267 millert 55: test -s /etc/sysctl.conf || return
56:
1.265 millert 57: # delete comments and blank lines
58: set -- `stripcom /etc/sysctl.conf`
59: while [ $# -ge 1 ] ; do
60: sysctl $1
61: # update limits if needed
62: case $1 in
63: kern.maxproc=*)
64: update_limit -p maxproc
65: ;;
66: kern.maxfiles=*)
67: update_limit -n openfiles
68: ;;
69: esac
70: shift
71: done
72: }
73:
74: mixerctl_conf()
75: {
1.267 millert 76: test -s /etc/mixerctl.conf || return
77:
1.265 millert 78: # delete comments and blank lines
79: set -- `stripcom /etc/mixerctl.conf`
80: while [ $# -ge 1 ] ; do
81: mixerctl -q $1 > /dev/null 2>&1
82: shift
83: done
84: }
85:
1.267 millert 86: wsconsctl_conf()
87: {
88: local save_IFS="$IFS"
89:
90: test -x /sbin/wsconsctl -a -s /etc/wsconsctl.conf || return
91: # delete comments and blank lines
92: IFS="
93: "
94: set -- `stripcom /etc/wsconsctl.conf`
95: IFS="$save_IFS"
96: while [ $# -ge 1 ] ; do
1.356 deraadt 97: eval wsconsctl $1
1.267 millert 98: shift
99: done
100: }
101:
1.312 djm 102: random_seed()
103: {
104: if [ -f /var/db/host.random -a "X$random_seed_done" = "X" ]; then
1.347 deraadt 105: dd if=/var/db/host.random of=/dev/arandom bs=65536 count=1 \
1.312 djm 106: > /dev/null 2>&1
1.328 deraadt 107:
1.312 djm 108: # reset seed file, so that if a shutdown-less reboot occurs,
109: # the next seed is not a repeat
1.347 deraadt 110: dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 \
1.312 djm 111: > /dev/null 2>&1
112:
113: random_seed_done=1
114: fi
115: }
116:
1.318 djm 117: fill_baddynamic()
118: {
119: local _service="$1"
120: local _sysctl="net.inet.${_service}.baddynamic"
121: local _name _port _srv _junk _ban
122: local _i=0
1.328 deraadt 123: grep "/${_service}" /etc/services | {
1.318 djm 124: IFS=" /"
125: while read _name _port _srv _junk; do
126: [ "x${_srv}" = "x${_service}" ] || continue;
127: if [ "x${_ban}" = "x" ]; then
128: _ban="+${_port}"
129: else
130: _ban="${_ban},+${_port}"
131: fi
132: # Flush before argv gets too long
133: if [ $((++_i)) -gt 128 ]; then
134: sysctl ${_sysctl}=${_ban} >/dev/null
135: _ban=""
136: _i=0
137: fi
1.328 deraadt 138: done;
1.318 djm 139: if [ "x${_ban}" != "x" ]; then
140: sysctl ${_sysctl}=${_ban} >/dev/null
141: fi
142: }
143: }
144:
1.353 robert 145: start_daemon()
146: {
1.354 robert 147: local _n
1.353 robert 148: for _n; do
149: eval _do=\${${_n}_flags}
150: if [ X"${_do}" != X"NO" ]; then
151: /etc/rc.d/${_n} start
152: fi
153: done
154: }
155:
1.373 ! deraadt 156: make_keys()
! 157: {
! 158: if [ X"${named_flags}" != X"NO" ]; then
! 159: if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then
! 160: echo -n "rndc-confgen: generating shared secret... "
! 161: if rndc-confgen -a -t /var/named >/dev/null 2>&1; then
! 162: chmod 0640 /var/named/etc/rndc.key \
! 163: >/dev/null 2>&1
! 164: echo done.
! 165: else
! 166: echo failed.
! 167: fi
! 168: fi
! 169: fi
! 170:
! 171: if [ ! -f /etc/isakmpd/private/local.key ]; then
! 172: echo -n "openssl: generating isakmpd/iked RSA key... "
! 173: if openssl genrsa -out /etc/isakmpd/private/local.key 2048 \
! 174: >/dev/null 2>&1; then
! 175: chmod 600 /etc/isakmpd/private/local.key
! 176: openssl rsa -out /etc/isakmpd/local.pub -in \
! 177: /etc/isakmpd/private/local.key -pubout \
! 178: >/dev/null 2>&1
! 179: echo done.
! 180: else
! 181: echo failed.
! 182: fi
! 183: fi
! 184:
! 185: if [ ! -f /etc/iked/private/local.key ]; then
! 186: # Just copy the generated isakmpd key
! 187: cp /etc/isakmpd/private/local.key /etc/iked/private/local.key
! 188: chmod 600 /etc/iked/private/local.key
! 189: cp /etc/isakmpd/local.pub /etc/iked/local.pub
! 190: fi
! 191:
! 192: ssh-keygen -A
! 193: }
! 194:
! 195: # create Unix sockets directories for X if needed and make sure they have
! 196: # correct permissions
! 197: setup_X_sockets()
! 198: {
! 199: if [ -d /usr/X11R6/lib ]; then
! 200: for d in /tmp/.X11-unix /tmp/.ICE-unix ; do
! 201: if [ -d $d ]; then
! 202: if [ `ls -ld $d | cut -d' ' -f4` \
! 203: != root ]; then
! 204: chown root $d
! 205: fi
! 206: if [ `ls -ld $d | cut -d' ' -f1` \
! 207: != drwxrwxrwt ]; then
! 208: chmod 1777 $d
! 209: fi
! 210: elif [ -e $d ]; then
! 211: echo "Error: $d exists and isn't a directory."
! 212: else
! 213: mkdir -m 1777 $d
! 214: fi
! 215: done
! 216: fi
! 217: }
! 218:
1.131 millert 219: # End subroutines
220:
1.1 deraadt 221: stty status '^T'
222:
223: # Set shell to ignore SIGINT (2), but not children;
224: # shell catches SIGQUIT (3) and returns to single user after fsck.
225: trap : 2
226: trap : 3 # shouldn't be needed
227:
228: HOME=/; export HOME
1.349 robert 229: INRC=1; export INRC
1.1 deraadt 230: PATH=/sbin:/bin:/usr/sbin:/usr/bin
231: export PATH
1.108 deraadt 232:
1.343 robert 233: # pick up option configuration
234: . /etc/rc.conf
235:
1.266 millert 236: if [ X"$1" = X"shutdown" ]; then
1.347 deraadt 237: dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 >/dev/null 2>&1
1.108 deraadt 238: chmod 600 /var/db/host.random >/dev/null 2>&1
1.352 ajacouto 239: local _c=$?
240: if [ ${_c} -eq 0 -a -n "${rc_scripts}" ]; then
241: echo -n 'stopping package daemons:'
242: while [ -n "${rc_scripts}" ]; do
243: _r=${rc_scripts##* }
244: rc_scripts=${rc_scripts%%*( )${_r}}
245: [ -x /etc/rc.d/${_r} ] && /etc/rc.d/${_r} stop
246: done
247: echo '.'
248: fi
249: if [ ${_c} -eq 0 -a -f /etc/rc.shutdown ]; then
1.108 deraadt 250: echo /etc/rc.shutdown in progress...
251: . /etc/rc.shutdown
252: echo /etc/rc.shutdown complete.
1.240 mcbride 253:
254: # bring carp interfaces down gracefully
1.331 sthen 255: ifconfig | while read a b; do
256: case $a in
257: carp+([0-9]):) ifconfig ${a%:} down ;;
1.329 sthen 258: esac
1.240 mcbride 259: done
1.246 mcbride 260:
1.266 millert 261: if [ X"${powerdown}" = X"YES" ]; then
1.246 mcbride 262: exit 2
263: fi
264:
1.108 deraadt 265: else
266: echo single user: not running /etc/rc.shutdown
267: fi
268: exit 0
269: fi
1.1 deraadt 270:
271: # Configure ccd devices.
1.17 deraadt 272: if [ -f /etc/ccd.conf ]; then
1.1 deraadt 273: ccdconfig -C
274: fi
1.98 jakob 275:
276: # Configure raid devices.
277: for dev in 0 1 2 3; do
278: if [ -f /etc/raid$dev.conf ]; then
279: raidctl -c /etc/raid$dev.conf raid$dev
280: fi
281: done
1.190 tdeval 282:
283: # Check parity on raid devices.
1.191 deraadt 284: raidctl -P all
1.1 deraadt 285:
1.172 miod 286: swapctl -A -t blk
1.170 deraadt 287:
1.17 deraadt 288: if [ -e /fastboot ]; then
1.1 deraadt 289: echo "Fast boot: skipping disk checks."
1.266 millert 290: elif [ X"$1" = X"autoboot" ]; then
1.1 deraadt 291: echo "Automatic boot in progress: starting file system checks."
1.31 millert 292: fsck -p
1.1 deraadt 293: case $? in
294: 0)
295: ;;
296: 2)
297: exit 1
298: ;;
299: 4)
300: echo "Rebooting..."
301: reboot
302: echo "Reboot failed; help!"
303: exit 1
304: ;;
305: 8)
306: echo "Automatic file system check failed; help!"
307: exit 1
308: ;;
309: 12)
310: echo "Boot interrupted."
311: exit 1
312: ;;
313: 130)
314: # interrupt before catcher installed
315: exit 1
316: ;;
317: *)
318: echo "Unknown error; help!"
319: exit 1
320: ;;
321: esac
322: fi
323:
324: trap "echo 'Boot interrupted.'; exit 1" 3
325:
326: umount -a >/dev/null 2>&1
1.303 grunk 327: mount -a -t nonfs,vnd
1.57 niklas 328: mount -uw / # root on nfs requires this, others aren't hurt
1.1 deraadt 329: rm -f /fastboot # XXX (root now writeable)
1.177 deraadt 330:
1.312 djm 331: random_seed
1.1 deraadt 332:
1.255 henning 333: # set flags on ttys. (do early, in case they use tty for SLIP in netstart)
1.1 deraadt 334: echo 'setting tty flags'
335: ttyflags -a
1.77 angelos 336:
1.252 mcbride 337: if [ -f /sbin/kbd -a -f /etc/kbdtype ]; then
338: kbd `cat /etc/kbdtype`
339: fi
340:
1.279 deraadt 341: wsconsctl_conf
342:
1.266 millert 343: if [ X"${pf}" != X"NO" ]; then
1.211 mcbride 344: RULES="block all"
1.228 henning 345: RULES="$RULES\npass on lo0"
1.195 dhartmei 346: RULES="$RULES\npass in proto tcp from any to any port 22 keep state"
1.208 camield 347: RULES="$RULES\npass out proto { tcp, udp } from any to any port 53 keep state"
1.215 camield 348: RULES="$RULES\npass out inet proto icmp all icmp-type echoreq keep state"
1.257 grange 349: if ifconfig lo0 inet6 >/dev/null 2>&1; then
1.258 itojun 350: RULES="$RULES\npass out inet6 proto icmp6 all icmp6-type neighbrsol"
351: RULES="$RULES\npass in inet6 proto icmp6 all icmp6-type neighbradv"
1.257 grange 352: RULES="$RULES\npass out inet6 proto icmp6 all icmp6-type routersol"
353: RULES="$RULES\npass in inet6 proto icmp6 all icmp6-type routeradv"
354: fi
1.322 mcbride 355: RULES="$RULES\npass proto carp keep state (no-sync)"
1.193 deraadt 356: case `sysctl vfs.mounts.nfs 2>/dev/null` in
1.184 deraadt 357: *[1-9]*)
358: # don't kill NFS
1.324 henning 359: RULES="set reassemble yes no-df\n$RULES"
1.306 deraadt 360: RULES="$RULES\npass in proto { tcp, udp } from any port { 111, 2049 } to any"
361: RULES="$RULES\npass out proto { tcp, udp } from any to any port { 111, 2049 }"
1.184 deraadt 362: ;;
363: esac
1.269 dhartmei 364: echo $RULES | pfctl -f -
365: pfctl -e
1.176 kjell 366: fi
1.318 djm 367:
368: # Fill net.inet.(tcp|udp).baddynamic lists from /etc/services
369: fill_baddynamic udp
370: fill_baddynamic tcp
1.176 kjell 371:
1.267 millert 372: sysctl_conf
1.260 jsg 373:
1.1 deraadt 374: # set hostname, turn on network
375: echo 'starting network'
1.289 henning 376: ifconfig -g carp carpdemote 128
1.264 deraadt 377: if [ -f /etc/resolv.conf.save ]; then
1.334 deraadt 378: mv -f /etc/resolv.conf.save /etc/resolv.conf
1.264 deraadt 379: touch /etc/resolv.conf
380: fi
1.1 deraadt 381: . /etc/netstart
1.348 deraadt 382: echo rekey > /dev/arandom # any write triggers an RC4 rekey
1.176 kjell 383:
1.266 millert 384: if [ X"${pf}" != X"NO" ]; then
1.176 kjell 385: if [ -f ${pf_rules} ]; then
1.198 dhartmei 386: pfctl -f ${pf_rules}
1.309 mpf 387: fi
388: # bring up pfsync after the working ruleset has been loaded
1.367 deraadt 389: if [ -f /etc/hostname.pfsync0 ]; then
390: . /etc/netstart pfsync0
391: fi
1.176 kjell 392: fi
1.1 deraadt 393:
1.278 otto 394: mount -s /usr >/dev/null 2>&1
395: mount -s /var >/dev/null 2>&1
1.180 deraadt 396:
1.346 deraadt 397: # if there's no /var/db/host.random, use /dev/arandom to create one
1.149 deraadt 398: if [ ! -f /var/db/host.random ]; then
1.347 deraadt 399: dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 \
1.149 deraadt 400: >/dev/null 2>&1
401: chmod 600 /var/db/host.random >/dev/null 2>&1
402: else
1.312 djm 403: # Try to read seed if it was not initially present (e.g. /var on NFS)
404: random_seed
1.149 deraadt 405: fi
1.29 deraadt 406:
1.55 deraadt 407: # clean up left-over files
408: rm -f /etc/nologin
409: rm -f /var/spool/lock/LCK.*
410: rm -f /var/spool/uucp/STST/*
1.247 henning 411: (cd /var/run && { rm -rf -- *; install -c -m 664 -g utmp /dev/null utmp; })
1.196 beck 412: (cd /var/authpf && rm -rf -- *)
1.96 alex 413:
414: # save a copy of the boot messages
415: dmesg >/var/run/dmesg.boot
1.55 deraadt 416:
1.373 ! deraadt 417: make_keys
! 418:
1.353 robert 419: echo -n 'starting system logger: '
420: start_daemon syslogd
421: echo '.'
1.184 deraadt 422:
1.310 sthen 423: if [ X"${pf}" != X"NO" ]; then
1.294 henning 424: ifconfig pflog0 create >/dev/null 2>&1
1.261 millert 425: if ifconfig pflog0 >/dev/null 2>&1; then
426: ifconfig pflog0 up
1.370 robert 427: start_daemon pflogd
1.261 millert 428: fi
1.217 jakob 429: fi
430:
1.266 millert 431: if [ X"${named_flags}" != X"NO" ]; then
1.221 jakob 432: if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then
433: echo -n "rndc-confgen: generating new shared secret... "
1.356 deraadt 434: if rndc-confgen -a -t /var/named >/dev/null 2>&1; then
1.221 jakob 435: chmod 0640 /var/named/etc/rndc.key >/dev/null 2>&1
436: echo done.
437: else
438: echo failed.
439: fi
440: fi
1.342 jakob 441: fi
442:
1.353 robert 443: echo -n 'starting name service daemons:'
444: start_daemon named nsd
445: echo '.'
1.287 mcbride 446:
1.333 deraadt 447: if [ ! -f /etc/isakmpd/private/local.key ]; then
1.338 reyk 448: echo -n "openssl: generating new isakmpd/iked RSA key... "
1.356 deraadt 449: if openssl genrsa -out /etc/isakmpd/private/local.key 2048 \
1.333 deraadt 450: > /dev/null 2>&1; then
451: chmod 600 /etc/isakmpd/private/local.key
452: openssl rsa -out /etc/isakmpd/local.pub \
453: -in /etc/isakmpd/private/local.key -pubout > /dev/null 2>&1
454: echo done.
455: else
456: echo failed.
457: fi
458: fi
459:
1.338 reyk 460: if [ ! -f /etc/iked/private/local.key ]; then
461: # Just copy the generated isakmpd key
462: cp /etc/isakmpd/private/local.key /etc/iked/private/local.key
463: chmod 600 /etc/iked/private/local.key
464: cp /etc/isakmpd/local.pub /etc/iked/local.pub
465: fi
466:
1.353 robert 467: echo -n 'starting IPsec daemons:'
468: start_daemon isakmpd iked sasyncd
469: echo '.'
1.280 hshoexer 470:
471: if [ X"${ipsec}" != X"NO" ]; then
472: if [ -f ${ipsec_rules} ]; then
473: ipsecctl -f ${ipsec_rules}
474: fi
1.40 provos 475: fi
1.1 deraadt 476:
1.276 tom 477: echo -n 'starting initial daemons:'
1.24 millert 478:
1.355 robert 479: start_daemon portmap
1.21 deraadt 480:
1.355 robert 481: [ X"`domainname`" != X"" ] && \
482: start_daemon ypserv ypldap ypbind yppasswdd
1.1 deraadt 483:
1.372 ajacouto 484: start_daemon mountd nfsd lockd statd
1.1 deraadt 485:
1.266 millert 486: if [ X"${amd}" = X"YES" -a -e ${amd_master} ]; then
1.1 deraadt 487: echo -n ' amd'
1.332 deraadt 488: (cd /etc/amd; amd `cat ${amd_master}`)
1.146 matt 489: fi
490:
1.358 deraadt 491: # run rdate before ntpd
1.255 henning 492: if [ X"${rdate_flags}" != X"NO" ]; then
493: echo -n ' rdate'; rdate -s ${rdate_flags}
494: fi
495:
1.358 deraadt 496: start_daemon ldattach ntpd
1.255 henning 497:
1.1 deraadt 498: echo '.'
1.58 deraadt 499:
1.278 otto 500: mount -a
1.172 miod 501:
502: swapctl -A -t noblk
1.1 deraadt 503:
504: # /var/crash should be a directory or a symbolic link
505: # to the crash directory if core dumps are to be saved.
506: if [ -d /var/crash ]; then
1.188 tholo 507: savecore ${savecore_flags} /var/crash
1.90 art 508: fi
509:
1.266 millert 510: if [ X"${check_quotas}" = X"YES" ]; then
1.41 downsj 511: echo -n 'checking quotas:'
512: quotacheck -a
513: echo ' done.'
514: quotaon -a
515: fi
1.1 deraadt 516:
1.362 deraadt 517: # build kvm(3) databases
1.88 millert 518: kvm_mkdb
1.1 deraadt 519: dev_mkdb
520:
1.101 deraadt 521: chmod 666 /dev/tty[pqrstuvwxyzPQRST]*
1.226 millert 522: chown root:wheel /dev/tty[pqrstuvwxyzPQRST]*
1.1 deraadt 523:
524: # check the password temp/lock file
1.17 deraadt 525: if [ -f /etc/ptmp ]; then
1.1 deraadt 526: logger -s -p auth.err \
527: 'password file may be incorrect -- /etc/ptmp exists'
1.32 deraadt 528: fi
529:
1.49 millert 530: echo clearing /tmp
531:
532: # prune quickly with one rm, then use find to clean up /tmp/[lq]*
533: # (not needed with mfs /tmp, but doesn't hurt there...)
1.339 sthen 534: (cd /tmp && rm -rf [a-km-pr-zA-Z]*)
535: (cd /tmp &&
1.49 millert 536: find . ! -name . ! -name lost+found ! -name quota.user \
1.103 millert 537: ! -name quota.group -execdir rm -rf -- {} \; -type d -prune)
1.49 millert 538:
1.256 henning 539: # create Unix sockets directories for X if needed and make sure they have
1.203 hugh 540: # correct permissions
1.210 henning 541: if [ -d /usr/X11R6/lib ]; then
1.203 hugh 542: for d in /tmp/.X11-unix /tmp/.ICE-unix ; do
1.210 henning 543: if [ -d $d ]; then
1.203 hugh 544: if [ `ls -ld $d | cut -d' ' -f4` != root ]; then
545: chown root $d
546: fi
547: if [ `ls -ld $d | cut -d' ' -f1` != drwxrwxrwt ]; then
548: chmod 1777 $d
549: fi
550: elif [ -e $d ]; then
551: echo "Error: $d exists and isn't a directory."
552: else
553: mkdir -m 1777 $d
554: fi
555: done
556: fi
1.373 ! deraadt 557:
! 558: setup_X_sockets
1.203 hugh 559:
1.72 deraadt 560: [ -f /etc/rc.securelevel ] && . /etc/rc.securelevel
1.266 millert 561: if [ X"${securelevel}" != X"" ]; then
1.33 millert 562: echo -n 'setting kernel security level: '
1.234 jmc 563: sysctl kern.securelevel=${securelevel}
1.1 deraadt 564: fi
565:
1.34 deraadt 566: # patch /etc/motd
567: if [ ! -f /etc/motd ]; then
568: install -c -o root -g wheel -m 664 /dev/null /etc/motd
569: fi
1.364 guenther 570: if T=`mktemp /tmp/_motd.XXXXXXXXXX`; then
1.102 millert 571: sysctl -n kern.version | sed 1q > $T
572: echo "" >> $T
573: sed '1,/^$/d' < /etc/motd >> $T
574: cmp -s $T /etc/motd || cp $T /etc/motd
575: rm -f $T
576: fi
1.34 deraadt 577:
1.298 ajacouto 578: if [ X"${accounting}" = X"YES" ]; then
579: if [ ! -f /var/account/acct ]; then
580: touch /var/account/acct
581: fi
1.1 deraadt 582: echo 'turning on accounting'; accton /var/account/acct
583: fi
584:
1.363 deraadt 585: if [ -f /sbin/ldconfig ]; then
1.115 deraadt 586: echo 'creating runtime link editor directory cache.'
587: if [ -d /usr/local/lib ]; then
1.183 todd 588: shlib_dirs="/usr/local/lib $shlib_dirs"
1.115 deraadt 589: fi
590: if [ -d /usr/X11R6/lib ]; then
1.183 todd 591: shlib_dirs="/usr/X11R6/lib $shlib_dirs"
1.115 deraadt 592: fi
593: ldconfig $shlib_dirs
1.231 millert 594: fi
595:
596: if [ -x /usr/libexec/vi.recover ]; then
1.314 jasper 597: echo 'preserving editor files.'; /usr/libexec/vi.recover
1.115 deraadt 598: fi
599:
1.356 deraadt 600: ssh-keygen -A
1.244 markus 601:
1.353 robert 602: echo -n 'starting network daemons:'
1.284 norby 603:
1.353 robert 604: start_daemon sshd snmpd ldpd ripd bgpd ifstated relayd dhcpd \
605: dhcrelay mrouted dvmrpd
1.127 itojun 606:
607: if ifconfig lo0 inet6 >/dev/null 2>&1; then
608: fw=`sysctl -n net.inet6.ip6.forwarding`
1.266 millert 609: if [ X"${fw}" = X"0" ]; then
1.353 robert 610: start_daemon rtsold
1.127 itojun 611: else
1.353 robert 612: start_daemon route6d
613: start_daemon rtadvd
1.127 itojun 614: fi
1.281 reyk 615: fi
616:
1.371 deraadt 617: start_daemon hostapd rwhod lpd ldapd sendmail smtpd httpd ftpd
618: start_daemon ftpproxy identd inetd rarpd bootparamd rbootd mopd spamd
1.365 robert 619:
620: [ X"${spamd_flags}" != X"NO" ] && \
1.319 deraadt 621: /usr/libexec/spamd-setup -D
1.365 robert 622:
1.369 robert 623: if [ X"${spamd_flags}" != X"NO" -a X"${spamd_black}" = X"NO" ]; then
1.365 robert 624: echo -n ' spamlogd'
625: /usr/libexec/spamlogd ${spamlogd_flags}
1.23 deraadt 626: fi
1.1 deraadt 627:
628: echo '.'
1.277 deraadt 629:
1.355 robert 630: if [ X"${kdc_flags}" != X"NO" ]; then
631: echo -n 'starting KerberosV daemons:'
632: start_daemon kdc kadmind kpasswdd
633: echo '.'
1.17 deraadt 634: fi
1.335 deraadt 635:
636: # If rc.firstime exists, run it just once, and make sure it is deleted
637: if [ -f /etc/rc.firsttime ]; then
638: mv /etc/rc.firsttime /etc/rc.firsttime.run
1.345 ajacouto 639: . /etc/rc.firsttime.run 2>&1 | mail -s 'rc.firsttime output' root >/dev/null
1.335 deraadt 640: fi
641: rm -f /etc/rc.firsttime.run
1.352 ajacouto 642:
643: # Run rc.d(8) scripts from packages
644: if [ -n "${rc_scripts}" ]; then
645: echo -n 'starting package daemons:'
646: for _r in $rc_scripts; do
1.368 robert 647: [ -x /etc/rc.d/${_r} ] && start_daemon ${_r}
1.352 ajacouto 648: done
649: echo '.'
650: fi
1.17 deraadt 651:
1.72 deraadt 652: [ -f /etc/rc.local ] && . /etc/rc.local
1.73 millert 653:
1.353 robert 654: echo -n 'starting standard daemons:'
1.87 marc 655:
1.353 robert 656: start_daemon apmd sensorsd hotplugd watchdogd cron
1.87 marc 657:
1.286 mcbride 658: # disable carp interlock
1.289 henning 659: ifconfig -g carp -carpdemote 128
1.286 mcbride 660:
1.73 millert 661: echo '.'
1.1 deraadt 662:
663: date
1.71 deraadt 664:
1.357 deraadt 665: mixerctl_conf
1.365 robert 666:
1.357 deraadt 667: echo -n 'starting console services:'
1.365 robert 668: start_daemon aucat wsmoused xdm
1.357 deraadt 669: echo '.'
1.286 mcbride 670:
1.1 deraadt 671: exit 0