Print this page
7928 Add support for SMF_EXIT_TEMP_TRANSIENT


   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 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.

  26 #
  27 
  28 smf_present () {
  29         [ -r /etc/svc/volatile/repository_door ] && \
  30             [ ! -f /etc/svc/volatile/repository_door ]
  31 }
  32 
  33 smf_clear_env () {
  34         unset \
  35                 SMF_FMRI \
  36                 SMF_METHOD \
  37                 SMF_RESTARTER \
  38                 SMF_ZONENAME
  39 }
  40 
  41 # smf_console
  42 #
  43 #   Use as "echo message 2>&1 | smf_console".  If SMF_MSGLOG_REDIRECT is
  44 #   unset, message will be displayed to console.  SMF_MSGLOG_REDIRECT is
  45 #   reserved for future use.


 225                 /usr/bin/sleep 0.2
 226                 time_waited=`/usr/bin/expr $time_waited + 2`
 227                 /usr/bin/pgrep -c $1 > /dev/null 2>&1
 228         done
 229 
 230         return 0
 231 }
 232 
 233 #
 234 # smf(5) method and monitor exit status definitions
 235 #   SMF_EXIT_ERR_OTHER, although not defined, encompasses all non-zero
 236 #   exit status values.
 237 #
 238 SMF_EXIT_OK=0
 239 SMF_EXIT_ERR_FATAL=95
 240 SMF_EXIT_ERR_CONFIG=96
 241 SMF_EXIT_MON_DEGRADE=97
 242 SMF_EXIT_MON_OFFLINE=98
 243 SMF_EXIT_ERR_NOSMF=99
 244 SMF_EXIT_ERR_PERM=100



   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 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  26 # Copyright 2017 RackTop Systems.
  27 #
  28 
  29 smf_present () {
  30         [ -r /etc/svc/volatile/repository_door ] && \
  31             [ ! -f /etc/svc/volatile/repository_door ]
  32 }
  33 
  34 smf_clear_env () {
  35         unset \
  36                 SMF_FMRI \
  37                 SMF_METHOD \
  38                 SMF_RESTARTER \
  39                 SMF_ZONENAME
  40 }
  41 
  42 # smf_console
  43 #
  44 #   Use as "echo message 2>&1 | smf_console".  If SMF_MSGLOG_REDIRECT is
  45 #   unset, message will be displayed to console.  SMF_MSGLOG_REDIRECT is
  46 #   reserved for future use.


 226                 /usr/bin/sleep 0.2
 227                 time_waited=`/usr/bin/expr $time_waited + 2`
 228                 /usr/bin/pgrep -c $1 > /dev/null 2>&1
 229         done
 230 
 231         return 0
 232 }
 233 
 234 #
 235 # smf(5) method and monitor exit status definitions
 236 #   SMF_EXIT_ERR_OTHER, although not defined, encompasses all non-zero
 237 #   exit status values.
 238 #
 239 SMF_EXIT_OK=0
 240 SMF_EXIT_ERR_FATAL=95
 241 SMF_EXIT_ERR_CONFIG=96
 242 SMF_EXIT_MON_DEGRADE=97
 243 SMF_EXIT_MON_OFFLINE=98
 244 SMF_EXIT_ERR_NOSMF=99
 245 SMF_EXIT_ERR_PERM=100
 246 SMF_EXIT_TEMP_TRANSIENT=101