Annotation of src/etc/rc, Revision 1.180
1.180 ! deraadt 1: # $OpenBSD: rc,v 1.179 2001/08/17 22:00:11 deraadt 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:
25: # End subroutines
26:
1.1 deraadt 27: stty status '^T'
28:
29: # Set shell to ignore SIGINT (2), but not children;
30: # shell catches SIGQUIT (3) and returns to single user after fsck.
31: trap : 2
32: trap : 3 # shouldn't be needed
33:
34: HOME=/; export HOME
35: PATH=/sbin:/bin:/usr/sbin:/usr/bin
36: export PATH
1.108 deraadt 37:
38: if [ $1x = shutdownx ]; then
39: dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1
40: chmod 600 /var/db/host.random >/dev/null 2>&1
41: if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then
42: echo /etc/rc.shutdown in progress...
43: . /etc/rc.shutdown
44: echo /etc/rc.shutdown complete.
45: if [ "X${powerdown}" = X"YES" ]; then
46: exit 2
47: fi
48: else
49: echo single user: not running /etc/rc.shutdown
50: fi
51: exit 0
52: fi
1.1 deraadt 53:
54: # Configure ccd devices.
1.17 deraadt 55: if [ -f /etc/ccd.conf ]; then
1.1 deraadt 56: ccdconfig -C
57: fi
1.98 jakob 58:
59: # Configure raid devices.
60: for dev in 0 1 2 3; do
61: if [ -f /etc/raid$dev.conf ]; then
62: raidctl -c /etc/raid$dev.conf raid$dev
1.158 angelos 63: raidctl -v -P raid$dev
1.98 jakob 64: fi
65: done
1.1 deraadt 66:
1.172 miod 67: swapctl -A -t blk
1.170 deraadt 68:
1.17 deraadt 69: if [ -e /fastboot ]; then
1.1 deraadt 70: echo "Fast boot: skipping disk checks."
1.17 deraadt 71: elif [ $1x = autobootx ]; then
1.1 deraadt 72: echo "Automatic boot in progress: starting file system checks."
1.31 millert 73: fsck -p
1.1 deraadt 74: case $? in
75: 0)
76: ;;
77: 2)
78: exit 1
79: ;;
80: 4)
81: echo "Rebooting..."
82: reboot
83: echo "Reboot failed; help!"
84: exit 1
85: ;;
86: 8)
87: echo "Automatic file system check failed; help!"
88: exit 1
89: ;;
90: 12)
91: echo "Boot interrupted."
92: exit 1
93: ;;
94: 130)
95: # interrupt before catcher installed
96: exit 1
97: ;;
98: *)
99: echo "Unknown error; help!"
100: exit 1
101: ;;
102: esac
103: fi
104:
105: trap "echo 'Boot interrupted.'; exit 1" 3
106:
107: umount -a >/dev/null 2>&1
108: mount -a -t nonfs
1.57 niklas 109: mount -uw / # root on nfs requires this, others aren't hurt
1.1 deraadt 110: rm -f /fastboot # XXX (root now writeable)
1.177 deraadt 111:
112: # pick up option configuration
113: . /etc/rc.conf
1.1 deraadt 114:
115: # set flags on ttys. (do early, in case they use tty for SLIP in netstart)
116: echo 'setting tty flags'
117: ttyflags -a
1.77 angelos 118:
1.176 kjell 119: if [ "X$pf" != X"NO" ]; then
120: echo "block in all\nblock out all" | pfctl -R - -e
121: fi
122:
1.126 deraadt 123: if [ -f /etc/sysctl.conf ]; then
124: (
125: # delete comments and blank lines
1.131 millert 126: set -- `stripcom /etc/sysctl.conf`
1.126 deraadt 127: while [ $# -ge 1 ] ; do
128: sysctl -w $1
1.129 millert 129: shift
1.126 deraadt 130: done
131: )
132: fi
133:
1.1 deraadt 134: # set hostname, turn on network
135: echo 'starting network'
136: . /etc/netstart
1.176 kjell 137:
138: if [ "X$pf" != X"NO" ]; then
139: if [ -f ${nat_rules} ]; then
140: pfctl -N ${nat_rules}
141: fi
142: if [ -f ${pf_rules} ]; then
143: pfctl -R ${pf_rules}
144: fi
145: fi
1.1 deraadt 146:
147: mount /usr >/dev/null 2>&1
148: mount /var >/dev/null 2>&1
1.180 ! deraadt 149:
! 150: if [ "X$pf" != X"NO" ]; then
! 151: pflogd
! 152: fi
1.149 deraadt 153:
154: # if there's no /var/db/host.random, make one through /dev/urandom
155: if [ ! -f /var/db/host.random ]; then
156: dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 \
157: >/dev/null 2>&1
158: chmod 600 /var/db/host.random >/dev/null 2>&1
159: else
160: dd if=/var/db/host.random of=/dev/urandom bs=1024 count=64 \
161: > /dev/null 2>&1
162: dd if=/var/db/host.random of=/dev/arandom bs=1024 count=64 \
163: > /dev/null 2>&1
164: fi
1.157 deraadt 165:
166: # reset seed file, so that if a shutdown-less reboot occurs,
167: # the next seed is not a repeat
168: dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 \
169: > /dev/null 2>&1
1.29 deraadt 170:
1.55 deraadt 171: # clean up left-over files
172: rm -f /etc/nologin
173: rm -f /var/spool/lock/LCK.*
174: rm -f /var/spool/uucp/STST/*
175: (cd /var/run && { rm -rf -- *; install -c -m 664 -g utmp /dev/null utmp; })
1.96 alex 176:
177: # save a copy of the boot messages
178: dmesg >/var/run/dmesg.boot
1.55 deraadt 179:
1.58 deraadt 180: echo 'starting system logger'
181: rm -f /dev/log
1.76 millert 182: if [ "X${named_flags}" != X"NO" -a "X${named_chroot}" != "X" ]; then
1.74 millert 183: rm -f ${named_chroot}/dev/log
184: syslogd_flags="${syslogd_flags} -a ${named_chroot}/dev/log"
185: fi
1.65 marc 186: syslogd ${syslogd_flags}
1.89 todd 187:
1.74 millert 188: # $named_flags, $named_user, and $named_chroot are imported from /etc/rc.conf;
1.54 deraadt 189: # if $named_flags != NO, named is run.
190: if [ "X${named_flags}" != X"NO" ]; then
1.74 millert 191: if [ "X${named_user}" != "X" -a "X${named_user}" != X"root" ]; then
192: named_flags="-u ${named_user} ${named_flags}"
193: fi
1.75 millert 194: if [ "X${named_chroot}" != "X" ]; then
1.81 millert 195: if [ ! -c "${named_chroot}/dev/null" ]; then
196: ( cd /dev ; pax -rw -pe null ${named_chroot}/dev )
1.83 millert 197: fi
198: if [ -f /etc/localtime -a -d "${named_chroot}/etc" ]; then
199: cmp -s /etc/localtime "${named_chroot}/etc/localtime" \
200: || cp -p /etc/localtime "${named_chroot}/etc/localtime"
1.81 millert 201: fi
1.74 millert 202: named_flags="-t ${named_chroot} ${named_flags}"
203: fi
1.58 deraadt 204: echo 'starting named'; named $named_flags
1.25 deraadt 205: fi
206:
1.52 deraadt 207: # $photurisd_flags is imported from /etc/rc.conf;
1.45 kstailey 208: # If $photurisd_flags == NO or /etc/photuris/photuris.conf doesn't exist, then
1.40 provos 209: # photurisd isn't run.
1.45 kstailey 210: if [ "X${photurisd_flags}" != X"NO" -a -e /etc/photuris/photuris.conf ]; then
1.40 provos 211: echo 'starting photurisd'; photurisd ${photurisd_flags}
1.94 deraadt 212: fi
213:
214: # $isakmpd_flags is imported from /etc/rc.conf;
1.125 deraadt 215: # If $isakmpd_flags == NO or /etc/isakmpd/isakmpd.conf doesn't exist, then
1.94 deraadt 216: # isakmpd isn't run.
1.125 deraadt 217: if [ "X${isakmpd_flags}" != X"NO" -a -e /etc/isakmpd/isakmpd.conf ]; then
1.94 deraadt 218: echo 'starting isakmpd'; isakmpd ${isakmpd_flags}
1.40 provos 219: fi
1.1 deraadt 220:
221: echo -n 'starting rpc daemons:'
1.24 millert 222:
1.52 deraadt 223: # $portmap is imported from /etc/rc.conf;
1.24 millert 224: # if $portmap == YES, the portmapper is started.
225: if [ X"${portmap}" = X"YES" ]; then
1.23 deraadt 226: echo -n ' portmap'; portmap
227: fi
1.1 deraadt 228:
1.174 deraadt 229: if [ -d /var/yp/binding -a X`domainname` != X ]; then
1.8 deraadt 230: if [ -d /var/yp/`domainname` ]; then
231: # yp server capabilities needed...
1.36 niklas 232: echo -n ' ypserv'; ypserv ${ypserv_flags}
1.16 deraadt 233: #echo -n ' ypxfrd'; ypxfrd
1.21 deraadt 234: fi
235:
236: echo -n ' ypbind'; ypbind
1.8 deraadt 237:
1.21 deraadt 238: if [ -d /var/yp/`domainname` ]; then
1.8 deraadt 239: # if we are the master server, run rpc.yppasswdd
240: _host1=`ypwhich -m passwd 2> /dev/null`
241: _host2=`hostname`
1.15 deraadt 242: if [ `grep '^lookup' /etc/resolv.conf | grep yp | wc -c` -ne 0 ]; then
1.8 deraadt 243: _host1=`ypmatch $_host1 hosts | cut -d' ' -f2`
244: _host2=`ypmatch $_host2 hosts | cut -d' ' -f2 | head -1`
245: else
246: _host1=`nslookup $_host1 | grep '^Name: ' | \
247: sed -e 's/^Name: //'`
248: _host2=`nslookup $_host2 | grep '^Name: ' | \
249: sed -e 's/^Name: //'`
250: fi
1.13 deraadt 251: if [ "$_host2" = "$_host1" ]; then
1.35 niklas 252: echo -n ' rpc.yppasswdd'
253: rpc.yppasswdd ${yppasswdd_flags}
1.8 deraadt 254: fi
1.7 deraadt 255: fi
1.1 deraadt 256: fi
257:
1.52 deraadt 258: # $nfs_server is imported from /etc/rc.conf;
1.1 deraadt 259: # if $nfs_server == YES, the machine is setup for being an nfs server
1.67 millert 260: if [ X${nfs_server} = X"YES" -a -s /etc/exports -a \
1.141 deraadt 261: `sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ]; then
1.68 millert 262: rm -f /var/db/mountdtab
1.1 deraadt 263: echo -n > /var/db/mountdtab
264: echo -n ' mountd'; mountd
1.42 niklas 265: echo -n ' nfsd'; nfsd ${nfsd_flags}
266: if [ X${lockd} = X"YES" ]; then
267: echo -n ' rpc.lockd'; rpc.lockd
268: fi
1.1 deraadt 269: fi
270:
1.165 deraadt 271: if [ X${amd} = X"YES" -a -e ${amd_master} ]; then
1.1 deraadt 272: echo -n ' amd'
1.107 deraadt 273: (cd /etc/amd; amd -l syslog -x error,noinfo,nostats -p \
274: -a ${amd_dir} `cat ${amd_master}` > /var/run/amd.pid )
1.146 matt 275: fi
276:
277: # run rdate before timed
1.148 millert 278: if [ X"${rdate_flags}" != X"NO" ]; then
1.146 matt 279: echo -n ' rdate'; rdate -s ${rdate_flags}
1.1 deraadt 280: fi
281:
1.52 deraadt 282: # $timed_flags is imported from /etc/rc.conf;
1.1 deraadt 283: # if $timed_flags == NO, timed isn't run.
284: if [ "X${timed_flags}" != X"NO" ]; then
1.58 deraadt 285: echo -n ' timed'; timed $timed_flags
1.1 deraadt 286: fi
287: echo '.'
1.58 deraadt 288:
289: mount -a -t nfs
1.172 miod 290:
291: swapctl -A -t noblk
1.1 deraadt 292:
293: # /var/crash should be a directory or a symbolic link
294: # to the crash directory if core dumps are to be saved.
295: if [ -d /var/crash ]; then
296: savecore /var/crash
297: fi
298:
1.90 art 299: if [ "X${afs}" = X"YES" -a -c ${afs_device} -a -d ${afs_mount_point} ]; then
300: echo -n 'mounting afs:'
1.91 art 301: mount -t xfs ${afs_device} ${afs_mount_point}
1.90 art 302: /usr/libexec/afsd ${afsd_flags} -d ${afs_device}
303: echo ' done.'
304: fi
305:
1.41 downsj 306: if [ "X${check_quotas}" = X"YES" ]; then
307: echo -n 'checking quotas:'
308: quotacheck -a
309: echo ' done.'
310: quotaon -a
311: fi
1.1 deraadt 312:
313: # build ps databases
1.95 deraadt 314: echo -n 'building ps databases:'
315: echo -n " kvm"
1.88 millert 316: kvm_mkdb
1.95 deraadt 317: echo -n " dev"
1.1 deraadt 318: dev_mkdb
1.95 deraadt 319: echo "."
1.1 deraadt 320:
1.101 deraadt 321: chmod 666 /dev/tty[pqrstuvwxyzPQRST]*
322: chown root.wheel /dev/tty[pqrstuvwxyzPQRST]*
1.1 deraadt 323:
324: # check the password temp/lock file
1.17 deraadt 325: if [ -f /etc/ptmp ]; then
1.1 deraadt 326: logger -s -p auth.err \
327: 'password file may be incorrect -- /etc/ptmp exists'
1.32 deraadt 328: fi
329:
1.49 millert 330: echo clearing /tmp
331:
332: # prune quickly with one rm, then use find to clean up /tmp/[lq]*
333: # (not needed with mfs /tmp, but doesn't hurt there...)
334: (cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
335: find . ! -name . ! -name lost+found ! -name quota.user \
1.103 millert 336: ! -name quota.group -execdir rm -rf -- {} \; -type d -prune)
1.49 millert 337:
1.72 deraadt 338: [ -f /etc/rc.securelevel ] && . /etc/rc.securelevel
1.32 deraadt 339: if [ X${securelevel} != X"" ]; then
1.33 millert 340: echo -n 'setting kernel security level: '
1.32 deraadt 341: sysctl -w kern.securelevel=${securelevel}
1.1 deraadt 342: fi
343:
1.34 deraadt 344: # patch /etc/motd
345: if [ ! -f /etc/motd ]; then
346: install -c -o root -g wheel -m 664 /dev/null /etc/motd
347: fi
1.131 millert 348: T=`mktemp /tmp/_motd.XXXXXXXXXX`
1.105 millert 349: if [ $? -eq 0 ]; then
1.102 millert 350: sysctl -n kern.version | sed 1q > $T
351: echo "" >> $T
352: sed '1,/^$/d' < /etc/motd >> $T
353: cmp -s $T /etc/motd || cp $T /etc/motd
354: rm -f $T
355: fi
1.34 deraadt 356:
1.121 millert 357: if [ -x /usr/libexec/vi.recover ]; then
358: echo 'preserving editor files'; /usr/libexec/vi.recover
1.1 deraadt 359: fi
360:
361: if [ -f /var/account/acct ]; then
362: echo 'turning on accounting'; accton /var/account/acct
363: fi
364:
1.115 deraadt 365: if [ -f /sbin/ldconfig ]; then
366: echo 'creating runtime link editor directory cache.'
367: if [ -d /usr/local/lib ]; then
368: shlib_dirs="$shlib_dirs /usr/local/lib"
369: fi
370: if [ -d /usr/X11R6/lib ]; then
371: shlib_dirs="$shlib_dirs /usr/X11R6/lib"
372: fi
373: ldconfig $shlib_dirs
374: fi
375:
1.150 deraadt 376: if [ ! -f /etc/ssh_host_dsa_key ]; then
1.133 deraadt 377: echo -n "ssh-keygen: generating new DSA host key... "
1.163 deraadt 378: if /usr/bin/ssh-keygen -q -t dsa -f /etc/ssh_host_dsa_key -N ''; then
379: echo done.
380: else
381: echo failed.
382: fi
383: fi
384: if [ ! -f /etc/ssh_host_rsa_key ]; then
385: echo -n "ssh-keygen: generating new RSA host key... "
386: if /usr/bin/ssh-keygen -q -t rsa -f /etc/ssh_host_rsa_key -N ''; then
1.133 deraadt 387: echo done.
388: else
389: echo failed.
390: fi
391: fi
1.150 deraadt 392: if [ ! -f /etc/ssh_host_key ]; then
1.133 deraadt 393: echo -n "ssh-keygen: generating new RSA host key... "
1.163 deraadt 394: if /usr/bin/ssh-keygen -q -t rsa1 -f /etc/ssh_host_key -N ''; then
1.114 deraadt 395: echo done.
396: else
397: echo failed.
398: fi
399: fi
400:
1.1 deraadt 401: echo -n starting network daemons:
402:
1.52 deraadt 403: # $gated and $routed_flags are imported from /etc/rc.conf.
1.1 deraadt 404: # If $gated == YES, gated is used; otherwise routed.
405: # If $routed_flags == NO, routed isn't run.
1.67 millert 406: if [ X${gated} = X"YES" -a -e /etc/gated.conf ]; then
1.151 brad 407: echo -n ' gated'; /usr/local/sbin/gated $gated_flags
1.1 deraadt 408: elif [ "X${routed_flags}" != X"NO" ]; then
409: echo -n ' routed'; routed $routed_flags
410: fi
411:
1.52 deraadt 412: # $mrouted_flags is imported from /etc/rc.conf;
1.4 deraadt 413: # If $mrouted_flags == NO, then mrouted isn't run.
414: if [ "X${mrouted_flags}" != X"NO" ]; then
415: echo -n ' mrouted'; mrouted $mrouted_flags
1.179 deraadt 416: fi
417:
418: # $altqd_flags is imported from /etc/rc.conf;
419: # If $altqd_flags == NO, then altqd isn't run.
420: if [ "X${altqd_flags}" != X"NO" ]; then
421: echo -n ' altqd'; altqd $altqd_flags
1.4 deraadt 422: fi
1.1 deraadt 423:
1.86 form 424: # $dhcpd_flags is imported from /etc/rc.conf
425: # If $dhcpd_flags == NO or /etc/dhcpd.conf doesn't exist, then dhcpd isn't run.
426: if [ "X${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then
427: touch /var/db/dhcpd.leases
428: if [ -f /etc/dhcpd.interfaces ]; then
1.141 deraadt 429: dhcpd_ifs=`awk -F\# '{ print $1; }' < /etc/dhcpd.interfaces`
1.86 form 430: fi
431: echo -n ' dhcpd'; /usr/sbin/dhcpd ${dhcpd_flags} ${dhcpd_ifs}
1.127 itojun 432: fi
433:
434: if ifconfig lo0 inet6 >/dev/null 2>&1; then
435: fw=`sysctl -n net.inet6.ip6.forwarding`
436: if [ "X${fw}" == X"0" ]; then
437: # $rtsold_flags is imported from /etc/rc.conf;
438: # If $rtsold_flags == NO, then rtsold isn't run.
439: if [ "X${rtsold_flags}" != X"NO" ]; then
440: echo -n ' rtsold'
441: /usr/sbin/rtsold ${rtsold_flags}
442: fi
443: else
444: # $route6d_flags is imported from /etc/rc.conf;
445: # If $route6d_flags == NO, then route6d isn't run.
446: if [ "X${route6d_flags}" != X"NO" ]; then
447: echo -n ' route6d'
448: /usr/sbin/route6d ${route6d_flags}
449: fi
450: # $rtadvd_flags is imported from /etc/rc.conf;
1.147 itojun 451: # If $rtadvd_flags == NO, then rtadvd isn't run.
452: if [ "X${rtadvd_flags}" != X"NO" ]; then
1.127 itojun 453: echo -n ' rtadvd'
454: /usr/sbin/rtadvd ${rtadvd_flags}
455: fi
456: fi
1.86 form 457: fi
458:
1.52 deraadt 459: # $rwhod is imported from /etc/rc.conf;
1.1 deraadt 460: # if $rwhod == YES, rwhod is run.
461: if [ X${rwhod} = X"YES" ]; then
462: echo -n ' rwhod'; rwhod
463: fi
464:
1.23 deraadt 465:
1.173 fgsch 466: if [ X${lpd_flags} != X"NO" ]; then
467: echo -n ' printer'; lpd ${lpd_flags}
1.23 deraadt 468: fi
1.1 deraadt 469:
1.52 deraadt 470: # $sendmail_flags is imported from /etc/rc.conf;
1.154 millert 471: # If $sendmail_flags == NO or /etc/mailer.conf doesn't exist, then
1.6 deraadt 472: # sendmail isn't run. We call sendmail with a full path so that
1.154 millert 473: # SIGHUP works. Note that /usr/sbin/sendmail may actually call a
474: # mailer other than sendmail, depending on /etc/mailer.conf.
475: if [ "X${sendmail_flags}" != X"NO" -a -s /etc/mailer.conf ]; then
1.153 millert 476: echo -n ' sendmail'; ( /usr/sbin/sendmail ${sendmail_flags} >/dev/null 2>&1 & )
1.69 deraadt 477: fi
478:
479: if [ "X${httpd_flags}" != X"NO" ]; then
1.143 espie 480: # Clean up left-over httpd locks
481: rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.*
1.160 angelos 482: echo -n ' httpd'; /usr/sbin/httpd ${httpd_flags}
1.93 downsj 483: fi
484:
485: if [ "X${ftpd_flags}" != X"NO" ]; then
486: echo -n ' ftpd'; /usr/libexec/ftpd ${ftpd_flags}
1.124 fgsch 487: fi
488:
489: if [ "X${identd_flags}" != X"NO" ]; then
490: echo -n ' identd'; /usr/libexec/identd ${identd_flags}
1.1 deraadt 491: fi
1.63 beck 492:
493: # $smtpfwdd_flags is imported from /etc/rc.conf;
494: # If $smtpfwdd_flags == NO, smtpfwdd isn't run.
495: if [ "X${smtpfwdd_flags}" != X"NO" ]; then
496: echo -n ' smtpfwdd'; /usr/libexec/smtpfwdd ${smtpfwdd_flags}
497: fi
498:
1.1 deraadt 499:
1.161 angelos 500: if [ X${inetd} = X"YES" -a -e /etc/inetd.conf ]; then
1.23 deraadt 501: echo -n ' inetd'; inetd
502: fi
1.1 deraadt 503:
1.52 deraadt 504: # $rarpd_flags is imported from /etc/rc.conf;
1.1 deraadt 505: # If $rarpd_flags == NO or /etc/ethers doesn't exist, then
506: # rarpd isn't run.
1.67 millert 507: if [ "X${rarpd_flags}" != X"NO" -a -s /etc/ethers ]; then
1.1 deraadt 508: echo -n ' rarpd'; rarpd ${rarpd_flags}
509: fi
510:
1.52 deraadt 511: # $bootparamd_flags is imported from /etc/rc.conf;
1.1 deraadt 512: # If $bootparamd_flags == NO or /etc/bootparams doesn't exist, then
513: # bootparamd isn't run.
1.67 millert 514: if [ "X${bootparamd_flags}" != X"NO" -a -s /etc/bootparams ]; then
1.1 deraadt 515: echo -n ' rpc.bootparamd'; rpc.bootparamd ${bootparamd_flags}
516: fi
517:
1.52 deraadt 518: # $rbootd_flags is imported from /etc/rc.conf;
1.1 deraadt 519: # If $rbootd_flags == NO or /etc/rbootd.conf doesn't exist, then
520: # rbootd isn't run.
1.67 millert 521: if [ "X${rbootd_flags}" != X"NO" -a -s /etc/rbootd.conf ]; then
1.1 deraadt 522: echo -n ' rbootd'; rbootd ${rbootd_flags}
1.56 maja 523: fi
524:
525: # $mopd_flags is imported from /etc/rc.conf;
526: # If $mopd_flags == NO or /tftpboot/mop doesn't exist, then
527: # mopd isn't run.
528: if [ "X${mopd_flags}" != X"NO" -a -d /tftpboot/mop ]; then
529: echo -n ' mopd'; mopd ${mopd_flags}
1.114 deraadt 530: fi
531:
1.167 deraadt 532: if [ X"${sshd_flags}" != X"NO" ]; then
533: /usr/sbin/sshd ${sshd_flags}; echo -n ' sshd'
1.1 deraadt 534: fi
535:
536: echo '.'
1.178 mickey 537:
538: if [ -f /etc/wsconsctl.conf ]; then
539: (
540: # delete comments and blank lines
541: set -- `stripcom /etc/wsconsctl.conf`
542: while [ $# -ge 1 ] ; do
543: wsconsctl -w $1
544: shift
545: done
546: )
547: fi
1.1 deraadt 548:
1.12 deraadt 549: if [ -f /sbin/kbd -a -f /etc/kbdtype ]; then
550: kbd `cat /etc/kbdtype`
1.53 deraadt 551: fi
1.17 deraadt 552:
1.175 hin 553: # KerberosIV runs ONLY on the KDC servers
554: # Kadmin runs only on the master server
555: if [ X${krb4_master_kdc} = X"YES" ]; then
556: echo 'KerberosIV KDC'
1.60 art 557: /usr/libexec/kerberos >> /var/log/kerberos.log &
558: /usr/libexec/kadmind -n >> /var/log/kadmind.log &
1.66 art 559: fi
560:
561: # Kpropd runs only on Kerberos slave servers
1.175 hin 562: if [ X${krb4_slave_kdc} = X"YES" ]; then
1.66 art 563: echo 'kerberos slave server'
564: /usr/libexec/kerberos -s >> /var/log/kerberos.log &
1.138 hin 565: /usr/libexec/kpropd -i &
1.175 hin 566: fi
567:
568: # KerberosV master KDC
569: if [ X${krb5_master_kdc} = X"YES" ]; then
570: echo 'KerberosV master KDC'
571: /usr/libexec/kdc &
572: /usr/libexec/kadmind &
573: /usr/libexec/kpasswdd &
574: fi
575:
576: # KerberosV slave KDC
577: if [ X${krb5_slave_kdc} = X"YES" ]; then
578: echo 'KerberosV slave KDC'
579: /usr/libexec/kdc &
580: # Remember to enable hpropd in inetd.conf
1.17 deraadt 581: fi
582:
1.72 deraadt 583: [ -f /etc/rc.local ] && . /etc/rc.local
1.73 millert 584:
585: echo -n standard daemons:
1.87 marc 586:
587: # $apmd_flags is imported from /etc/rc.conf;
588: # don't run daemon if $apmd_flags == NO or /usr/sbin/apmd doesn't exist
589: if [ "X${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then
590: echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags}
1.116 deraadt 591: fi
592:
593: if [ -x /usr/sbin/screenblank ]; then
594: echo -n ' screenblank'; /usr/sbin/screenblank
1.87 marc 595: fi
596:
1.73 millert 597: echo -n ' cron'; cron
1.87 marc 598:
1.73 millert 599: echo '.'
1.1 deraadt 600:
601: date
1.71 deraadt 602:
1.168 deraadt 603: if [ "X${wsmoused_flags}" != X"NO" -a -x /usr/sbin/wsmoused ]; then
1.169 deraadt 604: echo 'starting wsmoused...'; /usr/sbin/wsmoused ${wsmoused_flags}
1.155 aaron 605: fi
606:
1.71 deraadt 607: # Alternatively, on some architectures, xdm may be started in /etc/ttys.
608: if [ "X${xdm_flags}" != X"NO" ]; then
1.92 downsj 609: echo 'starting xdm...'; /usr/X11R6/bin/xdm ${xdm_flags}
1.71 deraadt 610: fi
611:
1.1 deraadt 612: exit 0
1.90 art 613: