Print this page
6805730 some simple changes would make 'init 5' much faster
6809492 startd shouldn't let hung subprocesses impede shutdown

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/initpkg/shutdown.sh
          +++ new/usr/src/cmd/initpkg/shutdown.sh
   1    1  #!/sbin/sh
   2    2  #
   3    3  # CDDL HEADER START
   4    4  #
   5    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.
        6 +# Common Development and Distribution License (the "License").
        7 +# You may not use this file except in compliance with the License.
   9    8  #
  10    9  # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  11   10  # or http://www.opensolaris.org/os/licensing.
  12   11  # See the License for the specific language governing permissions
  13   12  # and limitations under the License.
  14   13  #
  15   14  # When distributing Covered Code, include this CDDL HEADER in each
  16   15  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17   16  # If applicable, add the following below this CDDL HEADER, with the
  18   17  # fields enclosed by brackets "[]" replaced with your own identifying
  19   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  20   19  #
  21   20  # CDDL HEADER END
  22   21  #
  23      -#       Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
       22 +#       Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   23  #       Use is subject to license terms.
  25   24  #
  26   25  #       Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
  27   26  #         All Rights Reserved
  28   27  
  29   28  
  30   29  
  31      -#ident  "%Z%%M% %I%     %E% SMI"
  32      -
  33   30  #       Sequence performed to change the init state of a machine.  Only allows
  34   31  #       transitions to states 0,1,5,6,s,S (i.e.: down or administrative states).
  35   32  
  36   33  #       This procedure checks to see if you are permitted and allows an
  37   34  #       interactive shutdown.  The actual change of state, killing of
  38   35  #       processes and such are performed by the new init state, say 0,
  39   36  #       and its /sbin/rc0.
  40   37  
  41   38  usage() {
  42   39          echo "Usage: $0 [ -y ] [ -g<grace> ] [ -i<initstate> ] [ message ]"
↓ open down ↓ 89 lines elided ↑ open up ↑
 132  129          esac
 133  130  done
 134  131  shift `expr $OPTIND - 1`
 135  132  
 136  133  echo '\nShutdown started.    \c'
 137  134  /usr/bin/date
 138  135  echo
 139  136  
 140  137  NODENAME=`uname -n`
 141  138  
 142      -/sbin/sync
 143  139  cd /
 144  140  
 145  141  trap "rm $nologin >/dev/null 2>&1 ;exit 1"  1 2 15
 146  142  
 147  143  # If other users are on the system (and any grace period is given), warn them.
 148  144  
 149  145  for i in 7200 3600 1800 1200 600 300 120 60 30 10; do
 150  146          if [ ${grace} -gt $i ]
 151  147          then
 152  148                  hours=`/usr/bin/expr ${grace} / 3600`
↓ open down ↓ 86 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX