Print this page
7267 SMF is fast and loose with optional dependencies (fixes)
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Albert Lee <trisk@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/transition.c
          +++ new/usr/src/cmd/svc/startd/transition.c
↓ open down ↓ 155 lines elided ↑ open up ↑
 156  156          graph_transition_sulogin(RESTARTER_STATE_MAINT, old_state);
 157  157          return (0);
 158  158  }
 159  159  
 160  160  /* ARGSUSED */
 161  161  static int
 162  162  gt_enter_offline(scf_handle_t *h, graph_vertex_t *v,
 163  163      restarter_instance_state_t old_state, restarter_error_t rerr)
 164  164  {
 165  165          int to_offline = v->gv_flags & GV_TOOFFLINE;
      166 +        int to_disable = v->gv_flags & GV_TODISABLE;
 166  167  
 167  168          v->gv_flags &= ~GV_TOOFFLINE;
 168  169  
 169  170          /*
 170  171           * If the instance should be enabled, see if we can start it.
 171  172           * Otherwise send a disable command.
 172  173           * If a instance has the GV_TOOFFLINE flag set then it must
 173  174           * remains offline until the disable process completes.
 174  175           */
 175  176          if (v->gv_flags & GV_ENABLED) {
 176      -                if (to_offline == 0)
      177 +                if (to_offline == 0 && to_disable == 0)
 177  178                          graph_start_if_satisfied(v);
 178  179          } else {
 179  180                  if (gt_running(old_state) && v->gv_post_disable_f)
 180  181                          v->gv_post_disable_f();
 181  182  
 182  183                  vertex_send_event(v, RESTARTER_EVENT_TYPE_DISABLE);
 183  184          }
 184  185  
 185  186          /*
 186  187           * If the service was running, propagate a stop event.  If the
↓ open down ↓ 298 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX