Print this page
8891 One unmountable dataset on rpool breaks a lot of things

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/milestone/fs-local
          +++ new/usr/src/cmd/svc/milestone/fs-local
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14  # When distributing Covered Code, include this CDDL HEADER in each
  15   15  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16  # If applicable, add the following below this CDDL HEADER, with the
  17   17  # fields enclosed by brackets "[]" replaced with your own identifying
  18   18  # information: Portions Copyright [yyyy] [name of copyright owner]
  19   19  #
  20   20  # CDDL HEADER END
  21   21  #
  22   22  #
  23   23  # Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
       24 +# Copyright 2017 RackTop Systems.
  24   25  #
  25   26  
  26   27  . /lib/svc/share/smf_include.sh
  27   28  
  28   29  result=$SMF_EXIT_OK
  29   30  mntretry=0
  30   31  
  31   32  # Mount all local filesystems.
  32   33  
  33   34  cd /; /sbin/mountall -l >/var/run/fs-local 2>&1
↓ open down ↓ 3 lines elided ↑ open up ↑
  37   38          #  The only failures were lofs mounts, we can try again
  38   39          #  after zfs is mounted, there is a chance a lofs mount
  39   40          #  failed due to it depending on a zfs not yet mounted.
  40   41          #
  41   42          mntretry=1
  42   43  elif [ $rc -ne 0 ]; then
  43   44          cat /var/run/fs-local >/dev/msglog
  44   45          msg="WARNING: /sbin/mountall -l failed: exit status $rc"
  45   46          echo $msg
  46   47          echo "$SMF_FMRI:" $msg >/dev/msglog
  47      -        result=$SMF_EXIT_ERR_FATAL
       48 +        result=$SMF_EXIT_MON_DEGRADE
  48   49  fi
  49   50  rm -f /var/run/fs-local
  50   51  
  51   52  #
  52   53  # If there are non-global UFS filesystems with quotas, check and enable them.
  53   54  #
  54   55  
  55   56  # vlist is the non-global filesystems in vfstab requesting quotas
  56   57  vlist=`/usr/bin/nawk '$1 !~ /^(#|-)/ && $4 == "ufs" {
  57   58          if (match($7, "(^|,)(quota|rq)(,|$)") != 0 &&
↓ open down ↓ 28 lines elided ↑ open up ↑
  86   87  
  87   88  # Mount all ZFS filesystems.
  88   89  
  89   90  if [ -x /usr/sbin/zfs ]; then
  90   91          /usr/sbin/zfs mount -va >/dev/msglog 2>&1
  91   92          rc=$?
  92   93          if [ $rc -ne 0 ]; then
  93   94                  msg="WARNING: /usr/sbin/zfs mount -a failed: exit status $rc"
  94   95                  echo $msg
  95   96                  echo "$SMF_FMRI:" $msg >/dev/msglog
  96      -                result=$SMF_EXIT_ERR_FATAL
       97 +                result=$SMF_EXIT_MON_DEGRADE
  97   98          fi
  98   99  fi
  99  100  
 100  101  if [ $result = $SMF_EXIT_OK -a $mntretry -eq 1 ]
 101  102  then
 102  103          cd /; /sbin/mountall -l >/dev/msglog
 103  104          rc=$?
 104  105          if [ $rc -ne 0 ]; then
 105  106                  msg="WARNING: /sbin/mountall -l failed: exit status $rc"
 106  107                  echo $msg
 107  108                  echo "$SMF_FMRI:" $msg >/dev/msglog
 108      -                result=$SMF_EXIT_ERR_FATAL
      109 +                result=$SMF_EXIT_MON_DEGRADE
 109  110          fi
 110  111  fi
 111  112  
 112  113  # Add swap filesystems
 113  114  /sbin/swapadd >/dev/null 2>&1
 114  115  
 115  116  exit $result
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX