Print this page
7387 SMF is fast and loose with require_any/service dependencies
Reviewed by: Dan McDonald <danmcd@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/graph.c
          +++ new/usr/src/cmd/svc/startd/graph.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 (c) 2015, Syneto S.R.L. All rights reserved.
       25 + * Copyright 2016 RackTop Systems.
  25   26   */
  26   27  
  27   28  /*
  28   29   * graph.c - master restarter graph engine
  29   30   *
  30   31   *   The graph engine keeps a dependency graph of all service instances on the
  31   32   *   system, as recorded in the repository.  It decides when services should
  32   33   *   be brought up or down based on service states and dependencies and sends
  33   34   *   commands to restarters to effect any changes.  It also executes
  34   35   *   administrator commands sent by svcadm via the repository.
↓ open down ↓ 1255 lines elided ↑ open up ↑
1290 1291  
1291 1292                  log_framework2(LOG_DEBUG, DEBUG_DEPENDENCIES,
1292 1293                      "require_any(%s): %s is unsatisfi%s.\n",
1293 1294                      groupv->gv_name, edge->ge_vertex->gv_name,
1294 1295                      s == 0 ? "ed" : "able");
1295 1296  
1296 1297                  if (satbility && s == 0)
1297 1298                          satisfiable = B_TRUE;
1298 1299          }
1299 1300  
1300      -        return (!satbility || satisfiable ? 0 : -1);
     1301 +        if (!satbility)
     1302 +                return (0);
     1303 +
     1304 +        return (satisfiable ? 0 : -1);
1301 1305  }
1302 1306  
1303 1307  /*
1304 1308   * An optional_all dependency only considers elements which are configured,
1305 1309   * enabled, and not in maintenance.  If any are unsatisfied, then the dependency
1306 1310   * is unsatisfied.
1307 1311   *
1308 1312   * Offline dependencies which are waiting for a dependency to come online are
1309 1313   * unsatisfied.  Offline dependences which cannot possibly come online
1310 1314   * (unsatisfiable) are always considered satisfied.
↓ open down ↓ 5622 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX