Print this page
7711 SMF: Finish implementing support for degraded state

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/startd.c
          +++ new/usr/src/cmd/svc/startd/startd.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2015, Joyent, Inc.
       25 + * Copyright 2017 RackTop Systems.
  25   26   */
  26   27  
  27   28  /*
  28   29   * startd.c - the master restarter
  29   30   *
  30   31   * svc.startd comprises two halves.  The graph engine is based in graph.c and
  31   32   * maintains the service dependency graph based on the information in the
  32   33   * repository.  For each service it also tracks the current state and the
  33   34   * restarter responsible for the service.  Based on the graph, events from the
  34   35   * repository (mostly administrative requests from svcadm), and messages from
↓ open down ↓ 197 lines elided ↑ open up ↑
 232  233  mode_t dmask;
 233  234  
 234  235  graph_update_t *gu;
 235  236  restarter_update_t *ru;
 236  237  
 237  238  startd_state_t *st;
 238  239  
 239  240  boolean_t booting_to_single_user = B_FALSE;
 240  241  
 241  242  const char * const admin_actions[] = {
      243 +    SCF_PROPERTY_RESTORE,
 242  244      SCF_PROPERTY_DEGRADED,
      245 +    SCF_PROPERTY_DEGRADE_IMMEDIATE,
 243  246      SCF_PROPERTY_MAINT_OFF,
 244  247      SCF_PROPERTY_MAINT_ON,
 245  248      SCF_PROPERTY_MAINT_ON_IMMEDIATE,
 246  249      SCF_PROPERTY_REFRESH,
 247  250      SCF_PROPERTY_RESTART
 248  251  };
 249  252  
 250  253  const int admin_events[NACTIONS] = {
      254 +    RESTARTER_EVENT_TYPE_ADMIN_RESTORE,
 251  255      RESTARTER_EVENT_TYPE_ADMIN_DEGRADED,
      256 +    RESTARTER_EVENT_TYPE_ADMIN_DEGRADE_IMMEDIATE,
 252  257      RESTARTER_EVENT_TYPE_ADMIN_MAINT_OFF,
 253  258      RESTARTER_EVENT_TYPE_ADMIN_MAINT_ON,
 254  259      RESTARTER_EVENT_TYPE_ADMIN_MAINT_ON_IMMEDIATE,
 255  260      RESTARTER_EVENT_TYPE_ADMIN_REFRESH,
 256  261      RESTARTER_EVENT_TYPE_ADMIN_RESTART
 257  262  };
 258  263  
 259  264  const char * const instance_state_str[] = {
 260  265          "none",
 261  266          "uninitialized",
↓ open down ↓ 826 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX