Annotation of src/etc/rc, Revision 1.233
1.233 ! beck 1: # $OpenBSD: rc,v 1.232 2004/01/23 22:11:40 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
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.211 mcbride 122: RULES="block all"
1.228 henning 123: RULES="$RULES\npass on lo0"
1.195 dhartmei 124: RULES="$RULES\npass in proto tcp from any to any port 22 keep state"
1.208 camield 125: RULES="$RULES\npass out proto { tcp, udp } from any to any port 53 keep state"
1.215 camield 126: RULES="$RULES\npass out inet proto icmp all icmp-type echoreq keep state"
1.193 deraadt 127: case `sysctl vfs.mounts.nfs 2>/dev/null` in
1.184 deraadt 128: *[1-9]*)
129: # don't kill NFS
1.218 cedric 130: RULES="scrub in all no-df\n$RULES"
1.184 deraadt 131: RULES="$RULES\npass in proto udp from any port { 111, 2049 } to any"
132: RULES="$RULES\npass out proto udp from any to any port { 111, 2049 }"
133: ;;
134: esac
1.198 dhartmei 135: echo $RULES | pfctl -f - -e
1.176 kjell 136: fi
137:
1.126 deraadt 138: if [ -f /etc/sysctl.conf ]; then
139: (
140: # delete comments and blank lines
1.131 millert 141: set -- `stripcom /etc/sysctl.conf`
1.126 deraadt 142: while [ $# -ge 1 ] ; do
143: sysctl -w $1
1.129 millert 144: shift
1.126 deraadt 145: done
146: )
147: fi
148:
1.1 deraadt 149: # set hostname, turn on network
150: echo 'starting network'
151: . /etc/netstart
1.176 kjell 152:
1.186 deraadt 153: if [ "X${pf}" != X"NO" ]; then
1.176 kjell 154: if [ -f ${pf_rules} ]; then
1.198 dhartmei 155: pfctl -f ${pf_rules}
1.176 kjell 156: fi
157: fi
1.1 deraadt 158:
159: mount /usr >/dev/null 2>&1
160: mount /var >/dev/null 2>&1
1.180 deraadt 161:
1.149 deraadt 162: # if there's no /var/db/host.random, make one through /dev/urandom
163: if [ ! -f /var/db/host.random ]; then
164: dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 \
165: >/dev/null 2>&1
166: chmod 600 /var/db/host.random >/dev/null 2>&1
167: else
168: dd if=/var/db/host.random of=/dev/urandom bs=1024 count=64 \
169: > /dev/null 2>&1
170: dd if=/var/db/host.random of=/dev/arandom bs=1024 count=64 \
171: > /dev/null 2>&1
172: fi
1.157 deraadt 173:
174: # reset seed file, so that if a shutdown-less reboot occurs,
175: # the next seed is not a repeat
176: dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 \
177: > /dev/null 2>&1
1.29 deraadt 178:
1.55 deraadt 179: # clean up left-over files
180: rm -f /etc/nologin
181: rm -f /var/spool/lock/LCK.*
182: rm -f /var/spool/uucp/STST/*
1.192 millert 183: (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 184: (cd /var/authpf && rm -rf -- *)
185:
1.96 alex 186:
187: # save a copy of the boot messages
188: dmesg >/var/run/dmesg.boot
1.55 deraadt 189:
1.58 deraadt 190: echo 'starting system logger'
191: rm -f /dev/log
1.220 jakob 192: if [ "X${named_flags}" != X"NO" ]; then
193: rm -f /var/named/dev/log
194: syslogd_flags="${syslogd_flags} -a /var/named/dev/log"
1.216 millert 195: fi
196: if [ -d /var/empty ]; then
197: rm -f /var/empty/dev/log
198: mkdir -p -m 0555 /var/empty/dev
199: syslogd_flags="${syslogd_flags} -a /var/empty/dev/log"
1.74 millert 200: fi
1.65 marc 201: syslogd ${syslogd_flags}
1.184 deraadt 202:
1.186 deraadt 203: if [ X"${pf}" != X"NO" -a X"${pflogd_flags}" != X"NO" ]; then
1.184 deraadt 204: ifconfig pflog0 up
205: pflogd ${pflogd_flags}
1.217 jakob 206: fi
207:
1.224 todd 208: # $named_flags is imported from /etc/rc.conf;
1.54 deraadt 209: # if $named_flags != NO, named is run.
210: if [ "X${named_flags}" != X"NO" ]; then
1.221 jakob 211: if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then
212: echo -n "rndc-confgen: generating new shared secret... "
213: if /usr/sbin/rndc-confgen -a -t /var/named >/dev/null 2>&1; then
214: chmod 0640 /var/named/etc/rndc.key >/dev/null 2>&1
215: echo done.
216: else
217: echo failed.
218: fi
219: fi
220:
1.58 deraadt 221: echo 'starting named'; named $named_flags
1.94 deraadt 222: fi
223:
224: # $isakmpd_flags is imported from /etc/rc.conf;
1.185 angelos 225: # If $isakmpd_flags == NO or /etc/isakmpd/isakmpd.policy doesn't exist, then
1.94 deraadt 226: # isakmpd isn't run.
1.185 angelos 227: if [ "X${isakmpd_flags}" != X"NO" -a -e /etc/isakmpd/isakmpd.policy ]; then
1.94 deraadt 228: echo 'starting isakmpd'; isakmpd ${isakmpd_flags}
1.40 provos 229: fi
1.1 deraadt 230:
231: echo -n 'starting rpc daemons:'
1.24 millert 232:
1.52 deraadt 233: # $portmap is imported from /etc/rc.conf;
1.24 millert 234: # if $portmap == YES, the portmapper is started.
235: if [ X"${portmap}" = X"YES" ]; then
1.23 deraadt 236: echo -n ' portmap'; portmap
237: fi
1.1 deraadt 238:
1.174 deraadt 239: if [ -d /var/yp/binding -a X`domainname` != X ]; then
1.8 deraadt 240: if [ -d /var/yp/`domainname` ]; then
241: # yp server capabilities needed...
1.36 niklas 242: echo -n ' ypserv'; ypserv ${ypserv_flags}
1.16 deraadt 243: #echo -n ' ypxfrd'; ypxfrd
1.21 deraadt 244: fi
245:
246: echo -n ' ypbind'; ypbind
1.8 deraadt 247:
1.232 deraadt 248: if [ X"${yppasswdd_flags}" != X"NO" -a -d /var/yp/`domainname` ]; then
1.8 deraadt 249: # if we are the master server, run rpc.yppasswdd
250: _host1=`ypwhich -m passwd 2> /dev/null`
251: _host2=`hostname`
1.15 deraadt 252: if [ `grep '^lookup' /etc/resolv.conf | grep yp | wc -c` -ne 0 ]; then
1.8 deraadt 253: _host1=`ypmatch $_host1 hosts | cut -d' ' -f2`
254: _host2=`ypmatch $_host2 hosts | cut -d' ' -f2 | head -1`
255: else
256: _host1=`nslookup $_host1 | grep '^Name: ' | \
257: sed -e 's/^Name: //'`
258: _host2=`nslookup $_host2 | grep '^Name: ' | \
259: sed -e 's/^Name: //'`
260: fi
1.13 deraadt 261: if [ "$_host2" = "$_host1" ]; then
1.35 niklas 262: echo -n ' rpc.yppasswdd'
263: rpc.yppasswdd ${yppasswdd_flags}
1.8 deraadt 264: fi
1.7 deraadt 265: fi
1.1 deraadt 266: fi
267:
1.52 deraadt 268: # $nfs_server is imported from /etc/rc.conf;
1.1 deraadt 269: # if $nfs_server == YES, the machine is setup for being an nfs server
1.67 millert 270: if [ X${nfs_server} = X"YES" -a -s /etc/exports -a \
1.141 deraadt 271: `sed -e '/^#/d' < /etc/exports | wc -l` -ne 0 ]; then
1.68 millert 272: rm -f /var/db/mountdtab
1.1 deraadt 273: echo -n > /var/db/mountdtab
274: echo -n ' mountd'; mountd
1.42 niklas 275: echo -n ' nfsd'; nfsd ${nfsd_flags}
276: if [ X${lockd} = X"YES" ]; then
277: echo -n ' rpc.lockd'; rpc.lockd
278: fi
1.1 deraadt 279: fi
280:
1.165 deraadt 281: if [ X${amd} = X"YES" -a -e ${amd_master} ]; then
1.1 deraadt 282: echo -n ' amd'
1.107 deraadt 283: (cd /etc/amd; amd -l syslog -x error,noinfo,nostats -p \
284: -a ${amd_dir} `cat ${amd_master}` > /var/run/amd.pid )
1.146 matt 285: fi
286:
287: # run rdate before timed
1.148 millert 288: if [ X"${rdate_flags}" != X"NO" ]; then
1.230 deraadt 289: echo -n ' rdate'; rdate -s ${rdate_flags}
1.1 deraadt 290: fi
291:
1.52 deraadt 292: # $timed_flags is imported from /etc/rc.conf;
1.1 deraadt 293: # if $timed_flags == NO, timed isn't run.
294: if [ "X${timed_flags}" != X"NO" ]; then
1.58 deraadt 295: echo -n ' timed'; timed $timed_flags
1.1 deraadt 296: fi
297: echo '.'
1.58 deraadt 298:
299: mount -a -t nfs
1.172 miod 300:
301: swapctl -A -t noblk
1.1 deraadt 302:
303: # /var/crash should be a directory or a symbolic link
304: # to the crash directory if core dumps are to be saved.
305: if [ -d /var/crash ]; then
1.188 tholo 306: savecore ${savecore_flags} /var/crash
1.1 deraadt 307: fi
308:
1.233 ! beck 309: if [ "X${afs}" = X"YES" -a -c /dev/xfs0 ]; then
1.90 art 310: echo -n 'mounting afs:'
1.233 ! beck 311: mkdir -p -m 0755 /afs
! 312: mount -t xfs /dev/xfs0 /afs
! 313: /usr/libexec/afsd ${afsd_flags}
1.90 art 314: echo ' done.'
315: fi
316:
1.41 downsj 317: if [ "X${check_quotas}" = X"YES" ]; then
318: echo -n 'checking quotas:'
319: quotacheck -a
320: echo ' done.'
321: quotaon -a
322: fi
1.1 deraadt 323:
324: # build ps databases
1.95 deraadt 325: echo -n 'building ps databases:'
326: echo -n " kvm"
1.88 millert 327: kvm_mkdb
1.95 deraadt 328: echo -n " dev"
1.1 deraadt 329: dev_mkdb
1.95 deraadt 330: echo "."
1.1 deraadt 331:
1.101 deraadt 332: chmod 666 /dev/tty[pqrstuvwxyzPQRST]*
1.226 millert 333: chown root:wheel /dev/tty[pqrstuvwxyzPQRST]*
1.1 deraadt 334:
335: # check the password temp/lock file
1.17 deraadt 336: if [ -f /etc/ptmp ]; then
1.1 deraadt 337: logger -s -p auth.err \
338: 'password file may be incorrect -- /etc/ptmp exists'
1.32 deraadt 339: fi
340:
1.49 millert 341: echo clearing /tmp
342:
343: # prune quickly with one rm, then use find to clean up /tmp/[lq]*
344: # (not needed with mfs /tmp, but doesn't hurt there...)
345: (cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
346: find . ! -name . ! -name lost+found ! -name quota.user \
1.103 millert 347: ! -name quota.group -execdir rm -rf -- {} \; -type d -prune)
1.49 millert 348:
1.203 hugh 349: # create Unix sockets directories for X if needed and make sure they have
350: # correct permissions
1.210 henning 351: if [ -d /usr/X11R6/lib ]; then
1.203 hugh 352: for d in /tmp/.X11-unix /tmp/.ICE-unix ; do
1.210 henning 353: if [ -d $d ]; then
1.203 hugh 354: if [ `ls -ld $d | cut -d' ' -f4` != root ]; then
355: chown root $d
356: fi
357: if [ `ls -ld $d | cut -d' ' -f1` != drwxrwxrwt ]; then
358: chmod 1777 $d
359: fi
360: elif [ -e $d ]; then
361: echo "Error: $d exists and isn't a directory."
362: else
363: mkdir -m 1777 $d
364: fi
365: done
366: fi
367:
1.72 deraadt 368: [ -f /etc/rc.securelevel ] && . /etc/rc.securelevel
1.32 deraadt 369: if [ X${securelevel} != X"" ]; then
1.33 millert 370: echo -n 'setting kernel security level: '
1.32 deraadt 371: sysctl -w kern.securelevel=${securelevel}
1.1 deraadt 372: fi
373:
1.34 deraadt 374: # patch /etc/motd
375: if [ ! -f /etc/motd ]; then
376: install -c -o root -g wheel -m 664 /dev/null /etc/motd
377: fi
1.131 millert 378: T=`mktemp /tmp/_motd.XXXXXXXXXX`
1.105 millert 379: if [ $? -eq 0 ]; then
1.102 millert 380: sysctl -n kern.version | sed 1q > $T
381: echo "" >> $T
382: sed '1,/^$/d' < /etc/motd >> $T
383: cmp -s $T /etc/motd || cp $T /etc/motd
384: rm -f $T
385: fi
1.34 deraadt 386:
1.1 deraadt 387: if [ -f /var/account/acct ]; then
388: echo 'turning on accounting'; accton /var/account/acct
389: fi
390:
1.115 deraadt 391: if [ -f /sbin/ldconfig ]; then
392: echo 'creating runtime link editor directory cache.'
393: if [ -d /usr/local/lib ]; then
1.183 todd 394: shlib_dirs="/usr/local/lib $shlib_dirs"
1.115 deraadt 395: fi
396: if [ -d /usr/X11R6/lib ]; then
1.183 todd 397: shlib_dirs="/usr/X11R6/lib $shlib_dirs"
1.115 deraadt 398: fi
399: ldconfig $shlib_dirs
1.231 millert 400: fi
401:
402: if [ -x /usr/libexec/vi.recover ]; then
403: echo 'preserving editor files'; /usr/libexec/vi.recover
1.115 deraadt 404: fi
405:
1.189 deraadt 406: if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
1.133 deraadt 407: echo -n "ssh-keygen: generating new DSA host key... "
1.189 deraadt 408: if /usr/bin/ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''; then
1.163 deraadt 409: echo done.
410: else
411: echo failed.
412: fi
413: fi
1.189 deraadt 414: if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
1.163 deraadt 415: echo -n "ssh-keygen: generating new RSA host key... "
1.189 deraadt 416: if /usr/bin/ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''; then
1.133 deraadt 417: echo done.
418: else
419: echo failed.
420: fi
421: fi
1.189 deraadt 422: if [ ! -f /etc/ssh/ssh_host_key ]; then
1.187 markus 423: echo -n "ssh-keygen: generating new RSA1 host key... "
1.189 deraadt 424: if /usr/bin/ssh-keygen -q -t rsa1 -f /etc/ssh/ssh_host_key -N ''; then
1.114 deraadt 425: echo done.
426: else
427: echo failed.
428: fi
429: fi
430:
1.1 deraadt 431: echo -n starting network daemons:
432:
1.227 ian 433: # $routed_flags are imported from /etc/rc.conf.
1.1 deraadt 434: # If $routed_flags == NO, routed isn't run.
1.227 ian 435: if [ "X${routed_flags}" != X"NO" ]; then
1.1 deraadt 436: echo -n ' routed'; routed $routed_flags
437: fi
438:
1.52 deraadt 439: # $mrouted_flags is imported from /etc/rc.conf;
1.4 deraadt 440: # If $mrouted_flags == NO, then mrouted isn't run.
441: if [ "X${mrouted_flags}" != X"NO" ]; then
442: echo -n ' mrouted'; mrouted $mrouted_flags
443: fi
1.1 deraadt 444:
1.86 form 445: # $dhcpd_flags is imported from /etc/rc.conf
446: # If $dhcpd_flags == NO or /etc/dhcpd.conf doesn't exist, then dhcpd isn't run.
447: if [ "X${dhcpd_flags}" != X"NO" -a -f /etc/dhcpd.conf ]; then
448: touch /var/db/dhcpd.leases
449: if [ -f /etc/dhcpd.interfaces ]; then
1.207 mpech 450: dhcpd_ifs=`stripcom /etc/dhcpd.interfaces`
1.86 form 451: fi
452: echo -n ' dhcpd'; /usr/sbin/dhcpd ${dhcpd_flags} ${dhcpd_ifs}
1.127 itojun 453: fi
454:
455: if ifconfig lo0 inet6 >/dev/null 2>&1; then
456: fw=`sysctl -n net.inet6.ip6.forwarding`
457: if [ "X${fw}" == X"0" ]; then
458: # $rtsold_flags is imported from /etc/rc.conf;
459: # If $rtsold_flags == NO, then rtsold isn't run.
460: if [ "X${rtsold_flags}" != X"NO" ]; then
461: echo -n ' rtsold'
462: /usr/sbin/rtsold ${rtsold_flags}
463: fi
464: else
465: # $route6d_flags is imported from /etc/rc.conf;
466: # If $route6d_flags == NO, then route6d isn't run.
467: if [ "X${route6d_flags}" != X"NO" ]; then
468: echo -n ' route6d'
469: /usr/sbin/route6d ${route6d_flags}
470: fi
471: # $rtadvd_flags is imported from /etc/rc.conf;
1.147 itojun 472: # If $rtadvd_flags == NO, then rtadvd isn't run.
473: if [ "X${rtadvd_flags}" != X"NO" ]; then
1.127 itojun 474: echo -n ' rtadvd'
475: /usr/sbin/rtadvd ${rtadvd_flags}
476: fi
477: fi
1.86 form 478: fi
479:
1.52 deraadt 480: # $rwhod is imported from /etc/rc.conf;
1.1 deraadt 481: # if $rwhod == YES, rwhod is run.
482: if [ X${rwhod} = X"YES" ]; then
483: echo -n ' rwhod'; rwhod
484: fi
485:
1.23 deraadt 486:
1.223 sturm 487: if [ "X${lpd_flags}" != X"NO" ]; then
1.173 fgsch 488: echo -n ' printer'; lpd ${lpd_flags}
1.23 deraadt 489: fi
1.1 deraadt 490:
1.52 deraadt 491: # $sendmail_flags is imported from /etc/rc.conf;
1.154 millert 492: # If $sendmail_flags == NO or /etc/mailer.conf doesn't exist, then
1.6 deraadt 493: # sendmail isn't run. We call sendmail with a full path so that
1.154 millert 494: # SIGHUP works. Note that /usr/sbin/sendmail may actually call a
495: # mailer other than sendmail, depending on /etc/mailer.conf.
496: if [ "X${sendmail_flags}" != X"NO" -a -s /etc/mailer.conf ]; then
1.153 millert 497: echo -n ' sendmail'; ( /usr/sbin/sendmail ${sendmail_flags} >/dev/null 2>&1 & )
1.212 deraadt 498: fi
499:
500: if [ "X${spamd_flags}" != X"NO" ]; then
501: echo -n ' spamd'; /usr/libexec/spamd ${spamd_flags}
1.222 deraadt 502: /usr/libexec/spamd-setup
1.69 deraadt 503: fi
504:
505: if [ "X${httpd_flags}" != X"NO" ]; then
1.143 espie 506: # Clean up left-over httpd locks
507: rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.*
1.160 angelos 508: echo -n ' httpd'; /usr/sbin/httpd ${httpd_flags}
1.93 downsj 509: fi
510:
511: if [ "X${ftpd_flags}" != X"NO" ]; then
512: echo -n ' ftpd'; /usr/libexec/ftpd ${ftpd_flags}
1.124 fgsch 513: fi
514:
515: if [ "X${identd_flags}" != X"NO" ]; then
516: echo -n ' identd'; /usr/libexec/identd ${identd_flags}
1.1 deraadt 517: fi
518:
1.161 angelos 519: if [ X${inetd} = X"YES" -a -e /etc/inetd.conf ]; then
1.23 deraadt 520: echo -n ' inetd'; inetd
521: fi
1.1 deraadt 522:
1.52 deraadt 523: # $rarpd_flags is imported from /etc/rc.conf;
1.1 deraadt 524: # If $rarpd_flags == NO or /etc/ethers doesn't exist, then
525: # rarpd isn't run.
1.67 millert 526: if [ "X${rarpd_flags}" != X"NO" -a -s /etc/ethers ]; then
1.1 deraadt 527: echo -n ' rarpd'; rarpd ${rarpd_flags}
528: fi
529:
1.52 deraadt 530: # $bootparamd_flags is imported from /etc/rc.conf;
1.1 deraadt 531: # If $bootparamd_flags == NO or /etc/bootparams doesn't exist, then
532: # bootparamd isn't run.
1.67 millert 533: if [ "X${bootparamd_flags}" != X"NO" -a -s /etc/bootparams ]; then
1.1 deraadt 534: echo -n ' rpc.bootparamd'; rpc.bootparamd ${bootparamd_flags}
535: fi
536:
1.52 deraadt 537: # $rbootd_flags is imported from /etc/rc.conf;
1.1 deraadt 538: # If $rbootd_flags == NO or /etc/rbootd.conf doesn't exist, then
539: # rbootd isn't run.
1.67 millert 540: if [ "X${rbootd_flags}" != X"NO" -a -s /etc/rbootd.conf ]; then
1.1 deraadt 541: echo -n ' rbootd'; rbootd ${rbootd_flags}
1.56 maja 542: fi
543:
544: # $mopd_flags is imported from /etc/rc.conf;
545: # If $mopd_flags == NO or /tftpboot/mop doesn't exist, then
546: # mopd isn't run.
547: if [ "X${mopd_flags}" != X"NO" -a -d /tftpboot/mop ]; then
548: echo -n ' mopd'; mopd ${mopd_flags}
1.114 deraadt 549: fi
550:
1.167 deraadt 551: if [ X"${sshd_flags}" != X"NO" ]; then
1.201 deraadt 552: echo -n ' sshd'; /usr/sbin/sshd ${sshd_flags};
1.1 deraadt 553: fi
554:
555: echo '.'
1.178 mickey 556:
1.214 marc 557: if [ -x /sbin/wsconsctl -a -f /etc/wsconsctl.conf ]; then
1.178 mickey 558: (
559: # delete comments and blank lines
1.225 marc 560: save_IFS="$IFS"
1.214 marc 561: IFS="
562: "
1.178 mickey 563: set -- `stripcom /etc/wsconsctl.conf`
1.225 marc 564: IFS="$save_IFS"
1.178 mickey 565: while [ $# -ge 1 ] ; do
1.214 marc 566: eval /sbin/wsconsctl -w $1
1.178 mickey 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
1.230 deraadt 598: echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags}
1.229 henning 599: fi
600:
601: if [ X"${sensorsd_flags}" != X"NO" ]; then
602: echo -n ' sensorsd'; /usr/sbin/sensorsd ${sensorsd_flags}
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: