[BACK]Return to rc CVS log [TXT][DIR] Up to [local] / src / etc

Annotation of src/etc/rc, Revision 1.152

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