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