changeset 4752:19cfcd43280f

6566235 disabling and re-enabling put nfs/server service in offline state after restarting svc.startd
author vp157776
date Sun, 29 Jul 2007 21:23:00 -0700
parents 9b79196ab7db
children c0d0fedda3cf
files usr/src/cmd/cmd-inet/usr.lib/inetd/inetd.c
diffstat 1 files changed, 27 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/cmd-inet/usr.lib/inetd/inetd.c	Sun Jul 29 11:52:09 2007 -0700
+++ b/usr/src/cmd/cmd-inet/usr.lib/inetd/inetd.c	Sun Jul 29 21:23:00 2007 -0700
@@ -1654,9 +1654,36 @@
 	    "curr state: %d", instance->fmri, event, instance->cur_istate);
 
 	switch (event) {
+	case RESTARTER_EVENT_TYPE_ADD_INSTANCE:
+		/*
+		 * When startd restarts, it sends _ADD_INSTANCE to delegated
+		 * restarters for all those services managed by them. We should
+		 * acknowledge this event, as startd's graph needs to be updated
+		 * about the current state of the service, when startd is
+		 * restarting.
+		 * update_state() is ok to be called here, as commands for
+		 * instances in transition are deferred by
+		 * process_restarter_event().
+		 */
+		update_state(instance, instance->cur_istate, RERR_NONE);
+		goto done;
 	case RESTARTER_EVENT_TYPE_ADMIN_REFRESH:
 		refresh_instance(instance);
 		goto done;
+	case RESTARTER_EVENT_TYPE_ADMIN_RESTART:
+		/*
+		 * We've got a restart event, so if the instance is online
+		 * in any way initiate taking it offline, and rely upon
+		 * our restarter to send us an online event to bring
+		 * it back online.
+		 */
+		switch (instance->cur_istate) {
+		case IIS_ONLINE:
+		case IIS_DEGRADED:
+			destroy_bound_fds(instance);
+			(void) run_method(instance, IM_OFFLINE, NULL);
+		}
+		goto done;
 	case RESTARTER_EVENT_TYPE_REMOVE_INSTANCE:
 		remove_instance(instance);
 		goto done;
@@ -1681,20 +1708,6 @@
 			goto done;
 		}
 		break;
-	case RESTARTER_EVENT_TYPE_ADMIN_RESTART:
-		/*
-		 * We've got a restart event, so if the instance is online
-		 * in any way initiate taking it offline, and rely upon
-		 * our restarter to send us an online event to bring
-		 * it back online.
-		 */
-		switch (instance->cur_istate) {
-		case IIS_ONLINE:
-		case IIS_DEGRADED:
-			destroy_bound_fds(instance);
-			(void) run_method(instance, IM_OFFLINE, NULL);
-		}
-		goto done;
 	}
 
 	switch (instance->cur_istate) {