home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 5.ddi / sbin / rc2 < prev    next >
Encoding:
Text File  |  1990-12-08  |  1.3 KB  |  89 lines

  1.  
  2.  
  3.  
  4.  
  5. #    "Run Commands" executed when the system is changing to init state 2,
  6. #    traditionally called "multi-user".
  7.  
  8. . /etc/TIMEZONE
  9.  
  10. #    Pickup start-up packages for mounts, daemons, services, etc.
  11.  
  12. if i386
  13. then
  14.     /etc/conf/bin/idmkenv
  15. fi
  16.  
  17. set `/sbin/who -r`
  18. if [ x$9 = "xS" -o x$9 = "x1" ]
  19. then
  20.     echo 'The system is coming up.  Please wait.'
  21.     BOOT=yes
  22.  
  23. elif [ x$7 = "x2" ]
  24. then
  25.     echo 'Changing to state 2.'
  26.     if [ -d /etc/rc2.d ]
  27.     then
  28.         for f in /etc/rc2.d/K*
  29.         {
  30.             if [ -s ${f} ]
  31.             then
  32.                 /sbin/sh ${f} stop
  33.             fi
  34.         }
  35.     fi
  36. fi
  37.  
  38. if [ -d /etc/rc2.d ]
  39. then
  40.     for f in /etc/rc2.d/S*
  41.     {
  42.         if [ -s ${f} ]
  43.         then
  44.             /sbin/sh ${f} start
  45.         fi
  46.     }
  47. fi
  48.  
  49. # Execute rc scripts from driver packages (386)
  50. if [ -d /etc/idrc.d ]
  51. then
  52.     for f in /etc/idrc.d/*
  53.     {
  54.         if [ -s ${f} ]
  55.         then
  56.             /sbin/sh ${f}
  57.         fi
  58.     }
  59. fi
  60.  
  61. if [ "${BOOT}" = "yes" -a -d /etc/rc.d ]
  62. then
  63.     for f in `/usr/bin/ls /etc/rc.d`
  64.     {
  65.         if [ ! -s /etc/init.d/${f} ]
  66.         then
  67.             /sbin/sh /etc/rc.d/${f} 
  68.         fi
  69.     }
  70. fi
  71.  
  72. if [ x$9 = "xS" -o x$9 = "x1" ]
  73. then
  74.     if [ -f /etc/rc.d/PRESERVE ]    # historical segment for vi and ex
  75.     then
  76.         /usr/bin/mv /etc/rc.d/PRESERVE /etc/init.d
  77.         /usr/bin/ln /etc/init.d/PRESERVE /etc/rc2.d/S02PRESERVE
  78.     fi
  79. fi
  80.  
  81. if [ "${BOOT}" = "yes" -a x$7 = "x2" ]
  82. then
  83.     echo 'The system is ready.'
  84. elif [ x$7 = "x2" ]
  85. then
  86.     echo 'Change to state 2 has been completed.'
  87. fi
  88.  
  89.