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

Annotation of src/etc/rc, Revision 1.138

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