home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / template / client / etc / rc < prev    next >
Text File  |  1996-02-27  |  20KB  |  594 lines

  1. #!/bin/sh -u
  2. #
  3. # This is the multi-user startup script.
  4. #
  5. # Copyright (C) 1992 by NeXT Computer, Inc.  All rights reserved.
  6. #
  7. # Note that all "echo" commands are in parentheses so that
  8. # the main shell does not open a tty and get its process group set.
  9.  
  10. #
  11. # Avoid bailing out on ^C's.  This is needed both for security reasons
  12. # as well as for the "Press Control-C to continue without a network"
  13. # interaction (under ifconfig in rc.net) to function properly.
  14. #
  15. trap "/bin/true" 2
  16.  
  17. #
  18. # Initialize the path to be used and inherited by all the commands herein
  19. #
  20. if [ -f /.path ]; then
  21.     . /.path
  22. else
  23.     PATH=/usr/ucb:/bin:/usr/bin:/etc:/usr/etc; export PATH
  24.     HOME=/; export HOME
  25. fi
  26.  
  27. fbshow -B -E
  28. fbshow -B -I "Initializing system" -z 9
  29.  
  30.  
  31. # Are we booting from a CD-ROM?  If so, switch over to /etc/rc.cdrom.
  32.  
  33. if [ -d /NextCD -a -f /private/etc/rc.cdrom ]; then
  34.     /bin/sh /private/etc/rc.cdrom $1
  35.     (echo "CD-ROM boot procedure complete.")    >>/dev/console
  36.     /etc/halt -e
  37.     exit 0
  38. fi
  39.  
  40. # Start the Mach network message server, which forwards Mach IPC over the
  41. # network and provides a name-to-port mapping service.
  42. # We need to start the nmserver here because any of Config's device drivers
  43. # may need to register themselves with the name server.  Unfortuntely, the
  44. # network isn't ready yet, but that's OK since we tell the nmserver to
  45. # reinitialize its network code later in rc.net.
  46.  
  47. if [ -f /usr/etc/nmserver ]; then
  48.     /usr/etc/nmserver -nonet >/dev/console 2>&1
  49. fi
  50.  
  51. # Configure kern-loaded drivers - not on 68k (driverkit only)
  52. if [ `/usr/bin/arch` != m68k -a -f /usr/etc/driverLoader ]; then
  53.     (echo "Configuring Device Drivers")         >/dev/console
  54.     fbshow -B -I "Configuring drivers" -z 14
  55.     /usr/etc/driverLoader a >/dev/console 2>&1
  56. fi
  57.  
  58. for i in /dev/nrst*
  59. do
  60.     if [ -c $i ]; then
  61.         /usr/etc/stblocksize $i
  62.         (echo "Setting tape block size for $i")    > /dev/console
  63.     fi
  64. done
  65. #
  66. # Configure network & hostname
  67. #
  68. fbshow -B -I "Configuring network" -z 18
  69. sh /etc/rc.net -h >/dev/console
  70.  
  71. #
  72. #  Determine if the network is up by looking for any non-loopback
  73. #  internet network interfaces.
  74. #
  75. if ifconfig -a | fgrep -v "127.0.0.1" | fgrep -v "0.0.0.0" | grep -s inet; then
  76.     NETWORKUP=-YES-
  77. else
  78.     NETWORKUP=-NO-
  79. fi
  80.  
  81.  
  82. # Print out an appropriate message.  MESSAGE is used later in the log.
  83.  
  84. if  [ $1x = autobootx ]; then
  85.     # (echo Automatic reboot in progress...)        >/dev/console
  86.     MESSAGE="Reboot"
  87. else
  88.     (echo Multiuser startup in progress...)            >/dev/console
  89.     MESSAGE="Multi-user startup"
  90. fi
  91.  
  92. # Check for and mount swapdisks.
  93. sh /etc/rc.swap $1
  94.  
  95. # Mount local filesystems (according to /etc/fstab).
  96. mount -vat 4.3                        >/dev/console 2>&1
  97.  
  98. # Display a message in the iconic boot window.
  99. fbshow -B -I "Checking system files" -z 23
  100.  
  101. # Attempt to recover the passwd file, if needed.  This procedure is
  102. # primarily historical and makes sense only when the passwd file is edited
  103. # using the vipw command.  
  104.  
  105. if [ -s /etc/ptmp ]; then
  106.     if [ -s /etc/passwd ]; then
  107.         (echo 'Passwd file conflict with ptmp:')    >/dev/console
  108.         ls -l /etc/passwd /etc/ptmp            >/dev/console
  109.         (echo 'Moving ptmp to ptmp.save.')        >/dev/console
  110.         mv -f /etc/ptmp /etc/ptmp.save
  111.     else
  112.         (echo 'Passwd file recovered from ptmp.')     >/dev/console
  113.         mv /etc/ptmp /etc/passwd
  114.     fi
  115. elif [ -r /etc/ptmp ]; then
  116.     (echo 'Removing passwd lock file')            >/dev/console
  117.     /bin/rm -f /etc/ptmp
  118. fi
  119.  
  120. # Start the virtual memory system.
  121. /usr/etc/mach_swapon -av                >/dev/console 2>&1
  122.  
  123. (echo -n 'Cleaning up:')                >/dev/console
  124.  
  125. # If the shutdown command was used to shut the system down, the file
  126. # /etc/nologin may have been created to prevent users from logging in.  
  127. # Remove it so that logins are enabled when the system comes up.
  128.  
  129. /bin/rm -f /etc/nologin
  130. (echo -n ' /etc/nologin')                >/dev/console
  131.  
  132. # Reset pseudo-terminals (ptys) to their default states.
  133. /usr/etc/chown root.tty /dev/tty[pqrs]*
  134. /bin/chmod 666 /dev/tty[pqrs]*
  135. (echo -n ' ptys')                    >/dev/console
  136.  
  137. # Reset permissions and ownership of raw live floppy devices.
  138. # Loginwindow changes these to be owned by the logged in user.
  139. /usr/etc/chown root.operator /dev/rfd[01]b
  140. /bin/chmod 660 /dev/rfd[01]b
  141. (echo -n ' floppy devices')                                   >/dev/console
  142.  
  143. # Recover files being edited by ex, vi, or e when the system was restarted.
  144. (cd /tmp; /usr/lib/ex3.7preserve -a)
  145. (echo -n ' editors')                     >/dev/console
  146.  
  147. # Clean out /tmp.
  148. (cd /tmp; find . ! -name . ! -name lost+found ! -name quotas \
  149.     -exec rm -r - {} \; )
  150. (echo -n ' /tmp')                    >/dev/console
  151.  
  152. # Clear empty subdirectories of /Net.
  153. (cd /private/Net; find . -xdev ! -name . -type d -exec rmdir {} \;)
  154.  
  155. # Clear symlinks from /Net, too.
  156. (cd /private/Net; find . -xdev ! -name . -type l -exec rm {} \;)
  157. (echo -n ' /Net')                    >/dev/console
  158.  
  159. (echo '.')                        >/dev/console
  160.  
  161. # Syslog must be started before daemons are launched from rc.local.
  162. # This allows appropriate log messages to find their way to the console.
  163.  
  164. (echo -n Starting early daemons:)                >/dev/console
  165. fbshow -B -I "Starting background services" -z 27
  166. if [ -f /usr/etc/syslogd -a -f /etc/syslog.conf ]; then
  167.     /bin/rm -f /dev/log
  168.     # If you want a timestamp to be logged periodically,
  169.     # modify the invocation of syslogd below.  For example, 
  170.     # for a half-hourly timestamp, add the argument "-m30".
  171.     /usr/etc/syslogd  && (echo -n ' syslogd')        >/dev/console
  172. fi
  173. (echo '.')                            >/dev/console
  174.  
  175. # Read the configuration information set by the HostManager application.
  176. . /etc/hostconfig
  177.  
  178. # Set up NIS domain.
  179.  
  180. if [ "${YPDOMAIN=-NO-}" != "-NO-" -a $NETWORKUP = "-YES-" ]; then
  181.     (echo "Setting NIS domainname to $YPDOMAIN")        >/dev/console
  182.     domainname $YPDOMAIN                >/dev/console 2>&1
  183. fi
  184.  
  185. # Rpc and net services are the minimal set needed to use the network.
  186. (echo -n 'Starting RPC and network services:')            >/dev/console
  187.  
  188. # portmap converts Sun RPC program numbers into IP port numbers.
  189.  
  190. if [ -f /usr/etc/portmap ]; then
  191.     /usr/etc/portmap && (echo -n ' portmap')         >/dev/console
  192. fi
  193.  
  194. # Turn on IP routing.  If an explicit route is specified (the '*'
  195. # clause), either an IP address must be used or the router's hostname 
  196. # and IP address must be specified in the /etc/hosts file.  
  197. # Set the 'q' (quiet) flag by default to avoid broadcasting routes
  198. # all over the place.  [This should probably be an option.]
  199.  
  200. case ${ROUTER=-NO-} in
  201.     -ROUTED-)
  202.     if [ -f /usr/etc/routed -a $NETWORKUP = "-YES-" ]; then
  203.         /usr/etc/routed -q && (echo -n ' routed')    >/dev/console
  204.     fi
  205.     ;;
  206.     -NO-)
  207.     ;;
  208.     *)
  209.     if [ -f /usr/etc/route ]; then
  210.         /usr/etc/route add default $ROUTER 1    >/dev/console 2>&1
  211.     fi
  212.     ;;
  213. esac
  214.  
  215. # Start up the netinfo daemons.  This will only complete when the
  216. # local domain has bound to its parent domain, if it has a parent
  217. # (that is, if the machine is on a NetInfo network).  The message:
  218. #
  219. #   Still searching for parent network administration (NetInfo) server.
  220. #   Please wait, or press 'c' to continue without network user accounts.
  221. #   See your system administrator if you need help.
  222. #
  223. # comes from the local domain's netinfod; typically, you can wait a minute
  224. # or two and the local domain will eventually find a parent. As the
  225. # message says, the system is still searching for a parent server.
  226. # Typing 'c' aborts that search, which is probably not what you want.  
  227. # (You're most likely to see this message on a network-wide NetInfo server.)
  228. #
  229. # If you would like to customize this message to include the name or
  230. # telephone number of a network administrator, edit the text of the
  231. # message in /usr/lib/NextStep/Resources/English.lproj/NetInfo.strings,
  232. # or its equivalent for your usual boot language.
  233.  
  234. if [ -f /usr/etc/nibindd ]; then
  235.     fbshow -B -I "Starting network services" -z 32
  236.     /usr/etc/nibindd && (echo -n ' netinfo')    >/dev/console 2>&1
  237. fi
  238.  
  239. # If we are in an NIS domain, start up the appropiate services.
  240.  
  241. if [ "$YPDOMAIN" != "-NO-" -a $NETWORKUP = "-YES-" ]; then
  242.     fbshow -B -I "Starting YP services" -z 36
  243.     # ypserv is run on NIS servers - machines with an /etc/yp/XXX dir
  244.     if [ -f /usr/etc/ypserv -a -d /etc/yp/$YPDOMAIN ]; then
  245.         /usr/etc/ypserv && (echo -n ' ypserv')        >/dev/console
  246.     fi
  247.     if [ -f /usr/etc/ypbind ]; then
  248.         /usr/etc/ypbind && (echo -n ' ypbind')        >/dev/console
  249.     fi
  250. fi
  251.  
  252. # The lookup daemon, lookupd, provides information to client programs
  253. # through the standard C library (such as gethostbyname()).  It obtains
  254. # the information from various network services: NetInfo, DNS (also called
  255. # the Domain Name Service - named - and BIND), and NIS.
  256.  
  257. if [ -f /usr/etc/nibindd -a -f /usr/etc/lookupd ]; then
  258.     fbshow -B -I "Starting naming services" -z 41
  259.     /usr/etc/lookupd && (echo -n ' lookupd')        >/dev/console
  260. fi
  261.  
  262. # Start up time service.  If you're doing any sort of network file 
  263. # access, be sure NTP is enabled and properly configured, or you may 
  264. # see very strange errors and file consistency problems.
  265. #
  266. # NeXT's ntpd has been modified to acquire the NTP server
  267. # configuration from NetInfo (the /locations/ntp directory).
  268.  
  269. case ${TIME=-AUTOMATIC-} in
  270.     -AUTOMATIC-)
  271.     if [ -f /usr/etc/ntpd -a $NETWORKUP = "-YES-" ]; then
  272.         # Synchronize our clock to the network's time.
  273.         /usr/etc/ntp -F             >/dev/null
  274.         # Fire off ntpd to keep the clock in sync.
  275.         /usr/etc/ntpd && (echo -n ' ntpd')    >/dev/console
  276.     fi
  277.     ;;
  278.     -NO-)
  279.     ;;
  280.     *)
  281.     ;;
  282. esac
  283.  
  284. # biod is the NFS asynchronous block I/O daemon, which implements
  285. # NFS read-ahead and write-behind caching on NFS clients.
  286.  
  287. if [ -f /usr/etc/biod -a $NETWORKUP = "-YES-" ]; then
  288.     fbshow -B -I "Starting I/O services" -z 45
  289.     /usr/etc/biod 4 && (echo -n ' biod')             >/dev/console
  290. fi
  291.  
  292. (echo '.')                            >/dev/console
  293.  
  294. # Mount remote filesystems.
  295. fbshow -B -I "Mounting file systems" -z 50
  296. (echo 'Mounting remote filesystems')                >/dev/console
  297. mount -at nfs                         >/dev/console 2>&1
  298.  
  299. fbshow -B -I "Starting system services" -z 54
  300.  
  301. # Fileservice daemons are needed to import and export filesystems.
  302. (echo -n 'Starting file service daemons:')            >/dev/console
  303.  
  304. # If AppleTalk (EtherTalk) is desired, start up the AppleTalk daemon.
  305.  
  306. if [ -f /usr/etc/atalkd ]; then
  307.     fbshow -B -I "Starting AppleTalk" -z 59
  308.     if /usr/etc/atalkd >/dev/console 2>&1; then
  309.     (echo -n ' atalkd')                >/dev/console
  310.       fi
  311. fi
  312.  
  313. # Start the automounter only if /Net is a directory that is not
  314. # a symlink (symlinks to directories qualify as directories to test's
  315. # -d operation).
  316.  
  317. if [ -h /Net -o -f /Net ]; then
  318.     (echo "Warning: NeXT NFS automounter did not run.")    >/dev/console
  319. else
  320.     if [ -f /usr/etc/autonfsmount -a $NETWORKUP = "-YES-" ]; then
  321.         # The autonfsmounter will attempt a remount every 10 seconds,
  322.         # cache names for 12 hours [43200 seconds], mount things in
  323.         # /private/Net, ignore any NIS auto.master map, be triggered
  324.         # by references in the /Net directory, and use the fstab
  325.         # map (i.e., look in the mounts database -- /mounts in NetInfo,
  326.         # for example) to locate remote filesystems.
  327.         fbshow -B -I "Starting automounter" -z 63
  328.         /usr/etc/autonfsmount    -tm 10 -tl 43200 \
  329.                     -a /private -m /Net -fstab \
  330.         && (echo -n ' autonfsmount') >/dev/console 2>&1
  331.     fi
  332. fi
  333.  
  334. # If exportfs finds something to export (either using /etc/exports or the
  335. # exports NetInfo directory), then start the NFS daemons (which service
  336. # NFS requests) and the mount server (which services NFS mount requests).
  337.  
  338. if [ -f /usr/etc/exportfs ]; then
  339.     # Clear the table of exported filesystems before running exportfs.
  340.     > /etc/xtab
  341.     fbshow -B -I "Exporting filesystems" -z 68
  342.     if /usr/etc/exportfs -a >/dev/console 2>&1; then
  343.     # There is no "right" number of nfsd's. Infrequently-accessed
  344.     # servers can get by with 4 or fewer.  8 is not excessive for 
  345.     # heavily-loaded servers.
  346.     /usr/etc/nfsd 6 && (echo -n ' nfsd')         >/dev/console
  347.     /usr/etc/rpc.mountd && (echo -n ' rpc.mountd')    >/dev/console 2>&1
  348.     fi
  349. fi
  350.  
  351. # If AppleShare is desired, start up the AppleShare daemon.
  352.  
  353. if [ -f /usr/etc/ashared ]; then
  354.     fbshow -B -I "Starting AppleShare" -z 72
  355.     if /usr/etc/ashared >/dev/console 2>&1; then
  356.     (echo -n ' ashared')                >/dev/console
  357.       fi
  358. fi
  359.  
  360. (echo '.')                            >/dev/console
  361.  
  362. # Network daemons provide service to the outside world.
  363. (echo -n Starting network daemons:)                >/dev/console
  364. fbshow -B -I "Starting network daemons" -z 77
  365.  
  366. # If we are a Network Master become a BOOTP and BOOTPARAM server.  This is
  367. # the only thing that depends on the value of NETMASTER from /etc/hostconfig.
  368.  
  369. if [ "${NETMASTER=-NO-}" = "-YES-" ]; then
  370.     # If /etc/bootptab file exists, become a BOOTP server.  Note
  371.     # that bootpd gets information from /etc/bootptab even when
  372.     # NetInfo is running (the per-client information comes from
  373.     # NetInfo; the global information comes from /etc/bootptab).
  374.     if [ -f /usr/etc/bootpd -a -f /etc/bootptab ]; then
  375.         /usr/etc/bootpd && (echo -n ' bootpd')        >/dev/console
  376.     fi
  377.  
  378.     # bootparamd doesn't need a flat file.
  379.     if [ -f /usr/etc/rpc.bootparamd ]; then
  380.         /usr/etc/rpc.bootparamd && \
  381.         (echo -n ' rpc.bootparamd')            >/dev/console
  382.     fi
  383. fi
  384.  
  385. # Run the arpLoader to make permanent ARP entries for SPARC clients.
  386. # Does nothing if this system is not a NetInstall server or if the 
  387. # server has no SPARC clients.
  388. if [ -f /usr/etc/arpLoader ]; then
  389.     /usr/etc/arpLoader
  390. fi
  391.  
  392. # Run the Internet server daemon.
  393. if [ -f /usr/etc/inetd ]; then
  394.     /usr/etc/inetd && (echo -n ' inetd')            >/dev/console
  395. fi
  396.  
  397. # Remove junk from the outbound mail queue directory and start up
  398. # the sendmail daemon. /usr/spool/mqueue is assumed here even though
  399. # it can be changed in the sendmail configuration file.
  400. #
  401. # sendmail is started even if there's no configuration file
  402. # in /etc/sendmail/sendmail.cf.  sendmail can find a configuration file
  403. # based on information in NetInfo (the sendmail.cf property in the 
  404. # /locations/sendmail directory). If no sendmail configuration file 
  405. # exists, sendmail will exit with an appropriate error message.
  406. #
  407. # Any messages which end up in the queue, rather than being delivered
  408. # or forwarded immediately, will be processed once each hour.
  409.  
  410. if [ -f /usr/lib/sendmail ]; then
  411.     (cd /usr/spool/mqueue; rm -f nf* lf*)
  412.     /usr/lib/sendmail -bd -q1h 2>/dev/console && \
  413.         (echo -n ' sendmail')    >/dev/console
  414. fi
  415.  
  416. # lpd is the Berkeley line printer daemon.
  417.  
  418. if [ -f /usr/lib/lpd ]; then
  419.     rm -f /dev/lpd/printer
  420.     /usr/lib/lpd && (echo -n ' printer')            >/dev/console
  421. fi
  422.  
  423. # Start an SNMP agent if configured to do so.
  424.  
  425. if [ -f /usr/etc/snmpd ]; then
  426.     if /usr/etc/snmpd -N >/dev/console 2>&1; then
  427.         (echo -n ' snmpd')                >/dev/console
  428.     fi
  429. fi
  430.  
  431. (echo '.')                            >/dev/console
  432.  
  433. # NeXT services support the application environment
  434. (echo -n 'Starting NeXT services:')                >/dev/console
  435. fbshow -B -I "Starting NeXT services" -z 81
  436.  
  437. # The pasteboard server is used by the AppKit.
  438.  
  439. if [ -f /usr/etc/pbs ]; then
  440.     /usr/etc/pbs &&    (echo -n ' pbs')            >/dev/console
  441. fi
  442.  
  443. # exec_faxes starts up any appropriate fax modem daemons.
  444.  
  445. if [ -f /usr/lib/NextPrinter/exec_faxes ]; then
  446.     /usr/lib/NextPrinter/exec_faxes && (echo -n ' exec_faxes')    >/dev/console
  447. fi
  448.  
  449. # If ISDN Networking is desired, start up the PhoneConnector in daemon mode.
  450.  
  451. /usr/bin/niutil -read . /localconfig/ISDN/Networking >/dev/null 2>&1
  452. if [ $? -eq 0 ]; then
  453.     if [ -f /NextAdmin/PhoneConnector.app/PhoneConnector ]; then
  454.         /NextAdmin/PhoneConnector.app/PhoneConnector -Daemon YES && \
  455.             (echo -n ' PhoneConnector')     >/dev/console
  456.     fi
  457. fi
  458.  
  459. (echo '.')                            >/dev/console
  460.  
  461. # Customizations to the startup sequence which load protocol
  462. # stacks such as AppleTalk should be placed in /etc/rc.local.protocols
  463. # This allows them to load before NetWare and get a right of first
  464. # refusal before NetWare on all incoming packets. When used with 802.3
  465. # framing, NetWare consumes all incoming packets and does not 
  466. # pass any on to protocol stacks loaded after NetWare.
  467.  
  468. if [ -f /etc/rc.local.protocols ]; then
  469.     sh /etc/rc.local.protocols $1
  470. fi
  471.  
  472. # If NetWare Networking is desired, start it.
  473.  
  474. ( /usr/bin/niutil -read . /localconfig/NetWare | \
  475.     /usr/bin/egrep 'enable.+YES' ) >/dev/null 2>&1
  476. if [ $? -eq 0 ]; then
  477.  
  478.     #   Don't start NetWare  unless there is at least one network interface up
  479.  
  480.     if [ -n "`ifconfig -a | grep en0 `" -o -n "`ifconfig -a | grep tr0 `" ]; then
  481.         (echo -n "Starting NetWare:")            >/dev/console 2>&1
  482.      fbshow -B -I "Starting NetWare" -z 86
  483.        # Load and start the kernel server.
  484.         if [ -f /usr/lib/kern_loader/nuc/nuc_reloc ]; then
  485.         /usr/etc/kl_util -a /usr/lib/kern_loader/nuc/nuc_reloc \
  486.         >/tmp/nuc_log 2>&1
  487.         (echo -n ' nuc_reloc ')                >/dev/console 2>&1
  488.         fi
  489.         if [ -f /usr/netware/bin/nucinit ]; then
  490.         /usr/netware/bin/nucinit            >/dev/console 2>&1
  491.         (echo -n ' nucinit')                >/dev/console 2>&1
  492.         fi
  493.  
  494.         # Configure the protocol stack.
  495.         if [ -f /usr/netware/etc/npsd ]; then
  496.         /usr/netware/etc/npsd && (echo -n ' npsd')    >/dev/console 2>&1
  497.         fi
  498.  
  499.         # Start the Management Portal, an internal port for communicating
  500.         # with the kernel server.
  501.         if [ -f /usr/netware/bin/nwmp ]; then
  502.         /usr/netware/bin/nwmp start && (echo -n ' nwmp') >/dev/console 2>&1
  503.         fi
  504.  
  505.         # Start the Netware Service Advertisement Protocol Daemon, which looks for
  506.         # NetWare servers' advertisement packets.
  507.         if [ -f /usr/netware/etc/sapd ]; then
  508.         /usr/netware/etc/sapd && (echo -n ' sapd')    >/dev/console 2>&1
  509.         fi
  510.  
  511.         # Start the NetWare automounter.
  512.         if [ -f /usr/etc/autoNetWaremount ]; then
  513.         /usr/etc/autoNetWaremount && (echo -n ' autoNetWaremount') \
  514.         >/dev/console 2>&1
  515.         fi
  516.     else
  517.         (echo -n 'No network interface: NetWare not started')    >/dev/console 2>&1
  518.     fi
  519.  
  520.     (echo '.')                            >/dev/console
  521. fi
  522.  
  523.  
  524. # InputManagers startup procedure (Japanese)
  525.  
  526. if [ -d /NextLibrary/InputManagers ]; then
  527.     (echo -n 'Starting input servers:')                >/dev/console
  528.     fbshow -B -I "Starting input servers" -z 90
  529.     for i in /NextLibrary/InputManagers/*
  530.     do
  531.         if [ -d $i ]; then
  532.             if [ $i = "/NextLibrary/InputManagers/Resources" ]; then
  533.                 continue
  534.             fi
  535.             rcfile=`basename $i`
  536.             if [ -f $i/${rcfile}.rc ]; then
  537.                 sh $i/${rcfile}.rc $1
  538.             fi
  539.         fi
  540.     done
  541.     (echo '.')                            >/dev/console
  542. fi
  543.  
  544. # Start up the 4.0 MessageService daemon
  545. if [ -f /usr/etc/MessageServiceDaemon.mess/MessageServiceDaemon ]; then
  546.     (echo -n Starting MessageServiceDaemon:)        >/dev/console
  547.     fbshow -B -I "Starting MessageServiceDaemon" -z 93
  548.     /usr/etc/MessageServiceDaemon.mess/MessageServiceDaemon >/dev/console 2>&1
  549. fi
  550.  
  551. # Any customizations to the startup sequence you would like to make should
  552. # be placed in /etc/rc.local; this way they can be preserved when your 
  553. # system is later upgraded to a new version of system software.
  554.  
  555. if [ -f /etc/rc.local ]; then
  556.     sh /etc/rc.local $1
  557. fi
  558.  
  559. # Unlock tip lines.  tip and UUCP share lock files so they don't get in
  560. # each other's way.
  561.  
  562. if [ -d /usr/spool/uucp ]; then
  563.     rm -f /usr/spool/uucp/LCK.*
  564.     rm -f /usr/spool/uucp/LCK/LCK.*
  565. fi
  566.  
  567. # Start standaard daemons that should always run
  568. (echo -n Starting standard daemons:)                >/dev/console
  569. fbshow -B -I "Starting standard daemons" -z 95
  570.  
  571. # update flushes the cached blocks from the filesystem using
  572. # the sync system call every 30 seconds.  This ensures the
  573. # disk is reasonably up-to-date in the event of a system crash.
  574.  
  575. update && (echo -n ' update')                    >/dev/console
  576.  
  577. # cron executes commands listed in /etc/crontab at specified times.
  578.  
  579. cron && (echo -n ' cron')                    >/dev/console
  580.  
  581. # accton is here for historical reasons.
  582.  
  583. # if [ -f /usr/adm/acct ]; then
  584. #    accton /usr/adm/acct && (echo -n ' accounting')        >/dev/console
  585. # fi
  586.  
  587. (echo '.')                            >/dev/console
  588.  
  589. # Submit a syslog note to indicate that we've successfully rebooted.
  590. /usr/ucb/logger -t reboot -p kern.crit "$MESSAGE complete"
  591. fbshow -B -I "Startup complete" -z 100
  592.  
  593. exit 0
  594.