diff options
author | rm88369 <none@none> | 2007-02-13 01:45:18 -0800 |
---|---|---|
committer | rm88369 <none@none> | 2007-02-13 01:45:18 -0800 |
commit | 73b709ea25679d17a96a8d7f8db6531cbcc800d5 (patch) | |
tree | 96d32c6d5c14390db28c044fdb0a4684a1d278df | |
parent | feb08c6bb47ceffa5bb7a70f2c0549113f40fcc5 (diff) | |
download | illumos-joyent-73b709ea25679d17a96a8d7f8db6531cbcc800d5.tar.gz |
6469233 multi-user fails to come online even though dependencies are resolved
6469521 Sometimes svc.startd speaks in code
6515840 boot performance from milestone=none can be improved
-rw-r--r-- | usr/src/cmd/svc/startd/graph.c | 6 | ||||
-rw-r--r-- | usr/src/cmd/svc/startd/protocol.c | 19 | ||||
-rw-r--r-- | usr/src/cmd/svc/startd/transition.c | 13 |
3 files changed, 28 insertions, 10 deletions
diff --git a/usr/src/cmd/svc/startd/graph.c b/usr/src/cmd/svc/startd/graph.c index 5e84afe6fa..9c2aa69ae2 100644 --- a/usr/src/cmd/svc/startd/graph.c +++ b/usr/src/cmd/svc/startd/graph.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -4190,7 +4190,7 @@ graph_transition_sulogin(restarter_instance_state_t state, if (state != old_state && st->st_load_complete && !go_single_user_mode && !go_to_level1 && halting == -1) { - if (!can_come_up() && !sulogin_thread_running) { + if (!sulogin_thread_running && !can_come_up()) { (void) startd_thread_create(sulogin_thread, NULL); sulogin_thread_running = B_TRUE; } @@ -5408,7 +5408,7 @@ graph_thread(void *arg) */ if (!go_single_user_mode && !go_to_level1 && halting == -1) { - if (!can_come_up() && !sulogin_thread_running) { + if (!sulogin_thread_running && !can_come_up()) { (void) startd_thread_create(sulogin_thread, NULL); sulogin_thread_running = B_TRUE; } diff --git a/usr/src/cmd/svc/startd/protocol.c b/usr/src/cmd/svc/startd/protocol.c index b75f3ad266..697c946e70 100644 --- a/usr/src/cmd/svc/startd/protocol.c +++ b/usr/src/cmd/svc/startd/protocol.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -282,8 +281,11 @@ state_cb(sysevent_t *syse, void *cookie) char *instance_name; nvlist_t *attr_list = NULL; int state, next_state; + char str_state[MAX_SCF_STATE_STRING_SZ]; + char str_next_state[MAX_SCF_STATE_STRING_SZ]; protocol_states_t *states; int err; + ssize_t sz; /* * Might fail due to a bad event or a lack of memory. Try @@ -309,8 +311,13 @@ state_cb(sysevent_t *syse, void *cookie) graph_protocol_send_event(instance_name, GRAPH_UPDATE_STATE_CHANGE, states); - log_framework(LOG_DEBUG, "%s: state updates for %s (%d, %d)\n", fmri, - instance_name, state, next_state); + sz = restarter_state_to_string(state, str_state, sizeof (str_state)); + assert(sz < sizeof (str_state)); + sz = restarter_state_to_string(next_state, str_next_state, + sizeof (str_next_state)); + assert(sz < sizeof (str_next_state)); + log_framework(LOG_DEBUG, "%s: state updates for %s (%s, %s)\n", fmri, + instance_name, str_state, str_next_state); nvlist_free(attr_list); return (0); } diff --git a/usr/src/cmd/svc/startd/transition.c b/usr/src/cmd/svc/startd/transition.c index 66fb7d8cdb..cbeb6017bf 100644 --- a/usr/src/cmd/svc/startd/transition.c +++ b/usr/src/cmd/svc/startd/transition.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -145,11 +145,22 @@ gt_enter_offline(scf_handle_t *h, graph_vertex_t *v, vertex_send_event(v, RESTARTER_EVENT_TYPE_DISABLE); } + /* + * If the service was running, propagate a stop event. If the + * service was not running the offline transition may satisfy + * optional dependencies and should be propagated to determine + * whether new dependents are satisfiable. + */ if (gt_running(old_state)) { log_framework(LOG_DEBUG, "Propagating stop of %s.\n", v->gv_name); graph_transition_propagate(v, PROPAGATE_STOP, rerr); + } else { + log_framework(LOG_DEBUG, "Propagating offline of %s.\n", + v->gv_name); + + graph_transition_propagate(v, PROPAGATE_SAT, rerr); } graph_transition_sulogin(RESTARTER_STATE_OFFLINE, old_state); |