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

Annotation of src/etc/rc, Revision 1.129

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