Print this page
6805730 some simple changes would make 'init 5' much faster
6809492 startd shouldn't let hung subprocesses impede shutdown
   1 #!/sbin/sh
   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License, Version 1.0 only
   7 # (the "License").  You may not use this file except in compliance
   8 # with the License.
   9 #
  10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  11 # or http://www.opensolaris.org/os/licensing.
  12 # See the License for the specific language governing permissions
  13 # and limitations under the License.
  14 #
  15 # When distributing Covered Code, include this CDDL HEADER in each
  16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17 # If applicable, add the following below this CDDL HEADER, with the
  18 # fields enclosed by brackets "[]" replaced with your own identifying
  19 # information: Portions Copyright [yyyy] [name of copyright owner]
  20 #
  21 # CDDL HEADER END
  22 #
  23 #
  24 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
  25 # All rights reserved.
  26 #
  27 #
  28 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  29 # Use is subject to license terms.
  30 #
  31 #ident  "%Z%%M% %I%     %E% SMI"
  32 
  33 # "Run Commands" for init states 0, 5 and 6.
  34 
  35 PATH=/usr/sbin:/usr/bin
  36 
  37 if [ -z "$SMF_RESTARTER" ]; then
  38         echo "Cannot be run outside smf(5)"
  39         exit 1
  40 fi
  41 
  42 # Export boot parameters to rc scripts
  43 
  44 set -- `/usr/bin/who -r`
  45 
  46 _INIT_RUN_LEVEL="$7"    # Current run-level
  47 _INIT_RUN_NPREV="$8"    # Number of times previously at current run-level
  48 _INIT_PREV_LEVEL="$9"   # Previous run-level
  49 
  50 set -- `/usr/bin/uname -a`
  51 


  69                                 *)      /lib/svc/bin/lsvcrun $f stop;;
  70                         esac
  71                 fi
  72         done
  73 
  74         # System cleanup functions ONLY (things that end fast!) 
  75 
  76         for f in /etc/rc0.d/S*; do
  77                 if [ -s $f ]; then
  78                         case $f in
  79                                 *.sh)   /lib/svc/bin/lsvcrun -s  $f start;;
  80                                 *)      /lib/svc/bin/lsvcrun $f start ;;
  81                         esac
  82                 fi
  83         done
  84 fi
  85 
  86 [ -f /etc/.dynamic_routing ] && /usr/bin/rm -f /etc/.dynamic_routing
  87 
  88 trap "" 15
  89 
  90 [ -x /usr/lib/acct/closewtmp ] && /usr/lib/acct/closewtmp
  91 /sbin/sync; /sbin/sync; /sbin/sync
   1 #!/sbin/sh
   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License (the "License").
   7 # You may not use this file except in compliance with the License.

   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
  24 # All rights reserved.
  25 #
  26 #
  27 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  28 # Use is subject to license terms.
  29 #

  30 
  31 # "Run Commands" for init states 0, 5 and 6.
  32 
  33 PATH=/usr/sbin:/usr/bin
  34 
  35 if [ -z "$SMF_RESTARTER" ]; then
  36         echo "Cannot be run outside smf(5)"
  37         exit 1
  38 fi
  39 
  40 # Export boot parameters to rc scripts
  41 
  42 set -- `/usr/bin/who -r`
  43 
  44 _INIT_RUN_LEVEL="$7"    # Current run-level
  45 _INIT_RUN_NPREV="$8"    # Number of times previously at current run-level
  46 _INIT_PREV_LEVEL="$9"   # Previous run-level
  47 
  48 set -- `/usr/bin/uname -a`
  49 


  67                                 *)      /lib/svc/bin/lsvcrun $f stop;;
  68                         esac
  69                 fi
  70         done
  71 
  72         # System cleanup functions ONLY (things that end fast!) 
  73 
  74         for f in /etc/rc0.d/S*; do
  75                 if [ -s $f ]; then
  76                         case $f in
  77                                 *.sh)   /lib/svc/bin/lsvcrun -s  $f start;;
  78                                 *)      /lib/svc/bin/lsvcrun $f start ;;
  79                         esac
  80                 fi
  81         done
  82 fi
  83 
  84 [ -f /etc/.dynamic_routing ] && /usr/bin/rm -f /etc/.dynamic_routing
  85 
  86 trap "" 15