comparison usr/src/cmd/svc/startd/method.c @ 12979:ab9ae749152f

PSARC/2009/617 Software Events Notification Parameters CLI PSARC/2009/618 snmp-notify: SNMP Notification Daemon for Software Events PSARC/2009/619 smtp-notify: Email Notification Daemon for Software Events PSARC/2010/225 fmd for non-global Solaris zones PSARC/2010/226 Solaris Instance UUID PSARC/2010/227 nvlist_nvflag(3NVPAIR) PSARC/2010/228 libfmevent additions PSARC/2010/257 sysevent_evc_setpropnvl and sysevent_evc_getpropnvl PSARC/2010/265 FMRI and FMA Event Stabilty, 'ireport' category 1 event class, and the 'sw' FMRI scheme PSARC/2010/278 FMA/SMF integration: instance state transitions PSARC/2010/279 Modelling panics within FMA PSARC/2010/290 logadm.conf upgrade 6392476 fmdump needs to pretty-print 6393375 userland ereport/ireport event generation interfaces 6445732 Add email notification agent for FMA and software events 6804168 RFE: Allow an efficient means to monitor SMF services status changes 6866661 scf_values_destroy(3SCF) will segfault if is passed NULL 6884709 Add snmp notification agent for FMA and software events 6884712 Add private interface to tap into libfmd_msg macro expansion capabilities 6897919 fmd to run in a non-global zone 6897937 fmd use of non-private doors is not safe 6900081 add a UUID to Solaris kernel image for use in crashdump identification 6914884 model panic events as a defect diagnosis in FMA 6944862 fmd_case_open_uuid, fmd_case_uuisresolved, fmd_nvl_create_defect 6944866 log legacy sysevents in fmd 6944867 enumerate svc scheme in topo 6944868 software-diagnosis and software-response fmd modules 6944870 model SMF maintenance state as a defect diagnosis in FMA 6944876 savecore runs in foreground for systems with zfs root and dedicated dump 6965796 Implement notification parameters for SMF state transitions and FMA events 6968287 SUN-FM-MIB.mib needs to be updated to reflect Oracle information 6972331 logadm.conf upgrade PSARC/2010/290
author Gavin Maltby <gavin.maltby@oracle.com>
date Fri, 30 Jul 2010 17:04:17 +1000
parents d60272412fb0
children fc9f3d59525e
comparison
equal deleted inserted replaced
12978:19d842faf8e4 12979:ab9ae749152f
18 * 18 *
19 * CDDL HEADER END 19 * CDDL HEADER END
20 */ 20 */
21 21
22 /* 22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 23 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
25 */ 24 */
26 25
27 /* 26 /*
28 * method.c - method execution functions 27 * method.c - method execution functions
29 * 28 *
1023 restarter_inst_t *inst; 1022 restarter_inst_t *inst;
1024 scf_handle_t *local_handle; 1023 scf_handle_t *local_handle;
1025 scf_instance_t *s_inst = NULL; 1024 scf_instance_t *s_inst = NULL;
1026 int r, exit_code; 1025 int r, exit_code;
1027 boolean_t retryable; 1026 boolean_t retryable;
1028 const char *aux; 1027 restarter_str_t reason;
1029 1028
1030 assert(0 <= info->sf_method_type && info->sf_method_type <= 2); 1029 assert(0 <= info->sf_method_type && info->sf_method_type <= 2);
1031 1030
1032 /* Get (and lock) the restarter_inst_t. */ 1031 /* Get (and lock) the restarter_inst_t. */
1033 inst = inst_lookup_by_id(info->sf_id); 1032 inst = inst_lookup_by_id(info->sf_id);
1061 * It's not there, but we need to call this so protocol.c 1060 * It's not there, but we need to call this so protocol.c
1062 * doesn't think it's in transition anymore. 1061 * doesn't think it's in transition anymore.
1063 */ 1062 */
1064 (void) restarter_instance_update_states(local_handle, inst, 1063 (void) restarter_instance_update_states(local_handle, inst,
1065 inst->ri_i.i_state, RESTARTER_STATE_NONE, RERR_NONE, 1064 inst->ri_i.i_state, RESTARTER_STATE_NONE, RERR_NONE,
1066 NULL); 1065 restarter_str_none);
1067 goto out; 1066 goto out;
1068 1067
1069 case EINVAL: 1068 case EINVAL:
1070 case ENOTSUP: 1069 case ENOTSUP:
1071 default: 1070 default:
1103 * We don't care whether the handle was rebound because this is 1102 * We don't care whether the handle was rebound because this is
1104 * the last thing we do with it. 1103 * the last thing we do with it.
1105 */ 1104 */
1106 (void) restarter_instance_update_states(local_handle, inst, 1105 (void) restarter_instance_update_states(local_handle, inst,
1107 inst->ri_i.i_next_state, RESTARTER_STATE_NONE, 1106 inst->ri_i.i_next_state, RESTARTER_STATE_NONE,
1108 info->sf_event_type, NULL); 1107 info->sf_event_type, info->sf_reason);
1109 1108
1110 (void) update_fault_count(inst, FAULT_COUNT_RESET); 1109 (void) update_fault_count(inst, FAULT_COUNT_RESET);
1111 1110
1112 goto out; 1111 goto out;
1113 } 1112 }
1143 else if (exit_code == SMF_EXIT_ERR_FATAL) 1142 else if (exit_code == SMF_EXIT_ERR_FATAL)
1144 log_transition(inst, START_FAILED_FATAL); 1143 log_transition(inst, START_FAILED_FATAL);
1145 else 1144 else
1146 log_transition(inst, START_FAILED_OTHER); 1145 log_transition(inst, START_FAILED_OTHER);
1147 1146
1148 if (r == ELOOP) 1147 if (r == ELOOP) {
1149 aux = "restarting_too_quickly"; 1148 reason = restarter_str_restarting_too_quickly;
1150 else if (retryable) 1149 } else if (retryable) {
1151 aux = "fault_threshold_reached"; 1150 reason = restarter_str_fault_threshold_reached;
1152 else 1151 } else {
1153 aux = "method_failed"; 1152 reason = restarter_str_method_failed;
1153 }
1154 1154
1155 (void) restarter_instance_update_states(local_handle, inst, 1155 (void) restarter_instance_update_states(local_handle, inst,
1156 RESTARTER_STATE_MAINT, RESTARTER_STATE_NONE, RERR_FAULT, 1156 RESTARTER_STATE_MAINT, RESTARTER_STATE_NONE, RERR_FAULT,
1157 (char *)aux); 1157 reason);
1158 1158
1159 if (!method_is_transient(inst, info->sf_method_type) && 1159 if (!method_is_transient(inst, info->sf_method_type) &&
1160 inst->ri_i.i_primary_ctid != 0) 1160 inst->ri_i.i_primary_ctid != 0)
1161 method_remove_contract(inst, B_TRUE, B_TRUE); 1161 method_remove_contract(inst, B_TRUE, B_TRUE);
1162 1162