Example #1
0
/**
 * Forever wait on events and process them.
 */
static void main_process(void)
{
	NCS_SEL_OBJ mbx_fd;
	SaAisErrorT error = SA_AIS_OK;

	TRACE_ENTER();

	mbx_fd = ncs_ipc_get_sel_obj(&smfnd_cb->mbx);

	/* Set up all file descriptors to listen to */
	if (smfnd_cb->nid_started)
		fds[SMFND_AMF_FD].fd = smfnd_cb->usr1_sel_obj.rmv_obj;
	else
		fds[SMFND_AMF_FD].fd = smfnd_cb->amfSelectionObject;

	fds[SMFND_AMF_FD].events = POLLIN;
	fds[SMFND_MBX_FD].fd = mbx_fd.rmv_obj;
	fds[SMFND_MBX_FD].events = POLLIN;

	while (1) {
		int ret = poll(fds, SMFND_MAX_FD, -1);

		if (ret == -1) {
			if (errno == EINTR)
				continue;

			LOG_ER("poll failed - %s", strerror(errno));
			break;
		}

		/* Process all the AMF messages */
		if (fds[SMFND_AMF_FD].revents & POLLIN) {
			if (smfnd_cb->amf_hdl != 0) {
				/* dispatch all the AMF pending function */
				if ((error = saAmfDispatch(smfnd_cb->amf_hdl, SA_DISPATCH_ALL)) != SA_AIS_OK) {
					LOG_ER("saAmfDispatch failed: %u", error);
					break;
				}
			} else {
				TRACE("SIGUSR1 event rec");

				if (smfnd_amf_init(smfnd_cb) != NCSCC_RC_SUCCESS) {
					LOG_ER("amf init failed");
					break;
				}

				TRACE("AMF Initialization SUCCESS......");
				fds[SMFND_AMF_FD].fd = smfnd_cb->amfSelectionObject;
			}
		}

		/* Process all the Mail box events */
		if (fds[SMFND_MBX_FD].revents & POLLIN) {
			/* dispatch all the MBX events */
			smfnd_process_mbx(&smfnd_cb->mbx);
		}
	}
}
Example #2
0
/**
 * The main routine for the IMM director daemon.
 * @param argc
 * @param argv
 * 
 * @return int
 */
int main(int argc, char *argv[])
{
	SaAisErrorT error;
	NCS_SEL_OBJ mbx_fd;
	struct pollfd fds[3];

	daemonize(argc, argv);

	if (immd_initialize() != NCSCC_RC_SUCCESS) {
		TRACE("initialize_immd failed");
		goto done;
	}

	/* Get file descriptor for mailbox */
	mbx_fd = ncs_ipc_get_sel_obj(&immd_cb->mbx);

	/* Set up all file descriptors to listen to */
	fds[FD_USR1].fd = immd_cb->usr1_sel_obj.rmv_obj;
	fds[FD_USR1].events = POLLIN;
	fds[FD_MBCSV].fd = immd_cb->mbcsv_sel_obj;
	fds[FD_MBCSV].events = POLLIN;
	fds[FD_MBX].fd = mbx_fd.rmv_obj;
	fds[FD_MBX].events = POLLIN;

	while (1) {
		int ret = poll(fds, 3, -1);

		if (ret == -1) {
			if (errno == EINTR)
				continue;

			LOG_ER("poll failed - %s", strerror(errno));
			break;
		}

		if (fds[FD_MBCSV].revents & POLLIN) {
			if (immd_mbcsv_dispatch(immd_cb) != NCSCC_RC_SUCCESS) {
				LOG_ER("MBCSv Dispatch Failed");
				break;
			}
		}

		if (fds[FD_MBX].revents & POLLIN)
			immd_process_evt();

		if (fds[FD_AMF].revents & POLLIN) {
			if (immd_cb->amf_hdl != 0) {
				error = saAmfDispatch(immd_cb->amf_hdl, SA_DISPATCH_ALL);
				if (error != SA_AIS_OK) {
					LOG_ER("saAmfDispatch failed: %u", error);
					break;
				}
			} else {
				TRACE("SIGUSR1 event rec");
				ncs_sel_obj_rmv_ind(immd_cb->usr1_sel_obj, TRUE, TRUE);
				ncs_sel_obj_destroy(immd_cb->usr1_sel_obj);

				if (immd_amf_init(immd_cb) != NCSCC_RC_SUCCESS)
					break;

				TRACE("AMF Initialization SUCCESS......");
				fds[FD_AMF].fd = immd_cb->amf_sel_obj;
			}
		}
	}

done:
	LOG_ER("Failed, exiting...");
	TRACE_LEAVE();
	exit(1);
}
Example #3
0
/****************************************************************************
 * Name          : gld_main_process
 *
 * Description   : This is the function which is given as a input to the 
 *                 GLD task.
 *                 This function will be select of both the FD's (AMF FD and
 *                 Mail Box FD), depending on which FD has been selected, it
 *                 will call the corresponding routines.
 *
 * Arguments     : mbx  - This is the mail box pointer on which GLD is 
 *                        going to block.  
 *
 * Return Values : None.
 *
 * Notes         : None.
 *****************************************************************************/
static void gld_main_process(SYSF_MBX *mbx)
{
	NCS_SEL_OBJ mbx_fd;
	SaAisErrorT error = SA_AIS_OK;
	GLSV_GLD_CB *gld_cb = NULL;
	NCS_MBCSV_ARG mbcsv_arg;
	SaSelectionObjectT amf_sel_obj;

	if ((gld_cb = (GLSV_GLD_CB *)ncshm_take_hdl(NCS_SERVICE_ID_GLD, gl_gld_hdl))
	    == NULL) {
		m_LOG_GLD_HEADLINE(GLD_TAKE_HANDLE_FAILED, NCSFL_SEV_ERROR, __FILE__, __LINE__, 0);
		return;
	}
	mbx_fd = ncs_ipc_get_sel_obj(&gld_cb->mbx);
	error = saAmfSelectionObjectGet(gld_cb->amf_hdl, &amf_sel_obj);

	if (error != SA_AIS_OK) {
		m_LOG_GLD_SVC_PRVDR(GLD_AMF_SEL_OBJ_GET_ERROR, NCSFL_SEV_ERROR, __FILE__, __LINE__);
		return;
	}

	/* Set up all file descriptors to listen to */
	fds[FD_AMF].fd = amf_sel_obj;
	fds[FD_AMF].events = POLLIN;
	fds[FD_MBCSV].fd = gld_cb->mbcsv_sel_obj;
	fds[FD_MBCSV].events = POLLIN;
	fds[FD_MBX].fd = mbx_fd.rmv_obj;
	fds[FD_MBX].events = POLLIN;
	fds[FD_IMM].fd = gld_cb->imm_sel_obj;
	fds[FD_IMM].events = POLLIN;

	while (1) {
		if (gld_cb->immOiHandle != 0) {
			fds[FD_IMM].fd = gld_cb->imm_sel_obj;
			fds[FD_IMM].events = POLLIN;
			nfds = FD_IMM + 1;
		} else {
			nfds = FD_IMM;
		}

		int ret = poll(fds, nfds, -1);

		if (ret == -1) {
			if (errno == EINTR)
				continue;

			gld_log(NCSFL_SEV_ERROR, "poll failed - %s", strerror(errno));
			break;
		}

		if (fds[FD_AMF].revents & POLLIN) {
			if (gld_cb->amf_hdl != 0) {
				/* dispatch all the AMF pending function */
				error = saAmfDispatch(gld_cb->amf_hdl, SA_DISPATCH_ALL);
				if (error != SA_AIS_OK) {
					m_LOG_GLD_SVC_PRVDR(GLD_AMF_DISPATCH_ERROR, NCSFL_SEV_ERROR, __FILE__,
							    __LINE__);
				}
			} else
				gld_log(NCSFL_SEV_ERROR, "gld_cb->amf_hdl == 0");
		}

		if (fds[FD_MBCSV].revents & POLLIN) {
			/* dispatch all the MBCSV pending callbacks */
			mbcsv_arg.i_op = NCS_MBCSV_OP_DISPATCH;
			mbcsv_arg.i_mbcsv_hdl = gld_cb->mbcsv_handle;
			mbcsv_arg.info.dispatch.i_disp_flags = SA_DISPATCH_ALL;
			if (ncs_mbcsv_svc(&mbcsv_arg) != SA_AIS_OK) {
				m_LOG_GLD_HEADLINE(GLD_MBCSV_DISPATCH_FAILURE, NCSFL_SEV_ERROR, __FILE__, __LINE__, 0);
			}
		}

		if (fds[FD_MBX].revents & POLLIN)
			gld_process_mbx(mbx);

		/* process the IMM messages */
		if (gld_cb->immOiHandle && fds[FD_IMM].revents & POLLIN) {
			/* dispatch all the IMM pending function */
			error = saImmOiDispatch(gld_cb->immOiHandle, SA_DISPATCH_ONE);

			/*
			 ** BAD_HANDLE is interpreted as an IMM service restart. Try 
			 ** reinitialize the IMM OI API in a background thread and let 
			 ** this thread do business as usual especially handling write 
			 ** requests.
			 **
			 ** All other errors are treated as non-recoverable (fatal) and will
			 ** cause an exit of the process.
			 */
			if (error == SA_AIS_ERR_BAD_HANDLE) {
				gld_log(NCSFL_SEV_ERROR, "saImmOiDispatch returned BAD_HANDLE %u", error);

				/* 
				 ** Invalidate the IMM OI handle, this info is used in other
				 ** locations. E.g. giving TRY_AGAIN responses to a create and
				 ** close resource requests. That is needed since the IMM OI
				 ** is used in context of these functions.
				 */
				gld_cb->immOiHandle = 0;
				gld_imm_reinit_bg(gld_cb);
			} else if (error != SA_AIS_OK) {
				gld_log(NCSFL_SEV_ERROR, "saImmOiDispatch FAILED: %u", error);
				break;
			}
		}

	}
	return;
}
Example #4
0
/**
 * The main routine for the clms daemon.
 * @param argc
 * @param argv
 * 
 * @return int
 */
int main(int argc, char *argv[])
{
	NCS_SEL_OBJ mbx_fd;
	SaAisErrorT error = SA_AIS_OK;
	uint32_t rc;
	osaf_cluster = NULL;
	int term_fd;
	int timeout = -1;

	daemonize(argc, argv);

	if (clms_init() != NCSCC_RC_SUCCESS) {
		LOG_ER("clms_init failed");
		goto done;
	}

	mbx_fd = ncs_ipc_get_sel_obj(&clms_cb->mbx);
	daemon_sigterm_install(&term_fd);

	/* Set up all file descriptors to listen to */
	fds[FD_TERM].fd = term_fd;
	fds[FD_TERM].events = POLLIN;
	fds[FD_AMF].fd = clms_cb->nid_started ?
		usr1_sel_obj.rmv_obj : clms_cb->amf_sel_obj;
	fds[FD_AMF].events = POLLIN;
	fds[FD_MBCSV].fd = clms_cb->mbcsv_sel_obj;
	fds[FD_MBCSV].events = POLLIN;
	fds[FD_MBX].fd = mbx_fd.rmv_obj;
	fds[FD_MBX].events = POLLIN;
	fds[FD_IMM].fd = clms_cb->imm_sel_obj;
	fds[FD_IMM].events = POLLIN;

#ifdef ENABLE_AIS_PLM
	fds[FD_PLM].fd = clms_cb->plm_sel_obj;
	fds[FD_PLM].events = POLLIN;
#endif

	while (1) {

		if (clms_cb->rtu_pending == true) {
			TRACE("There is an IMM task to be tried again. setting poll time out to 500");
			timeout = 500;
		} else {
			timeout = -1;
		}

		if ((clms_cb->immOiHandle != 0) && (clms_cb->is_impl_set == true)) {
			fds[FD_IMM].fd = clms_cb->imm_sel_obj;
			fds[FD_IMM].events = POLLIN;
			nfds = NUM_FD;
		} else {
			nfds = NUM_FD - 1;
		}
		int ret = poll(fds, nfds, timeout);

		if (ret == -1) {
			if (errno == EINTR)
				continue;

			LOG_ER("poll failed - %s", strerror(errno));
			break;
		}

		if (ret == 0) {
			/* Process any/all pending RTAttribute updates to IMM */
			TRACE("poll time out processing pending updates");
			clms_retry_pending_rtupdates();
			continue;
		}
 
		if (fds[FD_TERM].revents & POLLIN) {
			daemon_exit();
		}

		if (fds[FD_AMF].revents & POLLIN) {
			if (clms_cb->amf_hdl != 0) {
				if ((error = saAmfDispatch(clms_cb->amf_hdl, SA_DISPATCH_ALL)) != SA_AIS_OK) {
					LOG_ER("saAmfDispatch failed: %u", error);
					break;
				}
			} else {
				TRACE("SIGUSR1 event rec");
				ncs_sel_obj_rmv_ind(usr1_sel_obj, true, true);
				ncs_sel_obj_destroy(usr1_sel_obj);

				if (clms_amf_init(clms_cb) != NCSCC_RC_SUCCESS) {
					LOG_ER("AMF Initialization failed");
					break;
				}

				TRACE("AMF Initialization SUCCESS......");
				fds[FD_AMF].fd = clms_cb->amf_sel_obj;
			}

		}

		if (fds[FD_MBCSV].revents & POLLIN) {
			if ((rc = clms_mbcsv_dispatch(clms_cb->mbcsv_hdl)) != NCSCC_RC_SUCCESS) {
				LOG_ER("MBCSv Dispatch Failed");
				break;
			}
		}

		if (fds[FD_MBX].revents & POLLIN) {
			clms_process_mbx(&clms_cb->mbx);
		}
#ifdef ENABLE_AIS_PLM
		/*Incase the Immnd restart is not supported fully,have to reint imm - TO Be Done */
		if (clms_cb->reg_with_plm == SA_TRUE){
			if (fds[FD_PLM].revents & POLLIN) {
				if ((error = saPlmDispatch(clms_cb->plm_hdl, SA_DISPATCH_ALL)) != SA_AIS_OK) {
					LOG_ER("saPlmDispatch FAILED: %u", error);
					break;
				}
			}
		}
#endif

		if (clms_cb->immOiHandle && fds[FD_IMM].revents & POLLIN) {
			if ((error = saImmOiDispatch(clms_cb->immOiHandle, SA_DISPATCH_ALL)) != SA_AIS_OK) {
				if (error == SA_AIS_ERR_BAD_HANDLE) {
					TRACE("main :saImmOiDispatch returned BAD_HANDLE");

					/* 
					 * Invalidate the IMM OI handle, this info is used in other
					 * locations. E.g. giving TRY_AGAIN responses to a create and
					 * close app stream requests. That is needed since the IMM OI
					 * is used in context of these functions.
					 * 
					 * Also closing the handle. Finalize is ok with a bad handle
					 * that is bad because it is stale and this actually clears
					 * the handle from internal agent structures.  In any case
					 * we ignore the return value from Finalize here.
					 */
					saImmOiFinalize(clms_cb->immOiHandle);
					clms_cb->immOiHandle = 0;
					clms_cb->is_impl_set = false;

					/* Initiate IMM reinitializtion in the background */
					clm_imm_reinit_bg(clms_cb);


				} else if (error != SA_AIS_OK) {
					LOG_ER("saImmOiDispatch FAILED: %u", error);
					break;
				}
			}
		}
		/* Retry any pending updates */
		if (clms_cb->rtu_pending == true)
			clms_retry_pending_rtupdates();
	} /* End while (1) */

 done:
	LOG_ER("Failed, exiting...");
	TRACE_LEAVE();
	exit(1);
}
Example #5
0
int main(int argc, char *argv[])
{
	uint32_t rc;
	nfds_t nfds = 4;
	struct pollfd fds[nfds + RDA_MAX_CLIENTS];
	int i, ret;
	NCS_SEL_OBJ mbx_sel_obj;
	RDE_RDA_CB *rde_rda_cb = &rde_cb->rde_rda_cb;
	int term_fd;

	daemonize(argc, argv);

	if (initialize_rde() != NCSCC_RC_SUCCESS)
		goto init_failed;

	mbx_sel_obj = ncs_ipc_get_sel_obj(&rde_cb->mbx);

	if ((rc = discover_peer(mbx_sel_obj.rmv_obj)) == NCSCC_RC_FAILURE)
		goto init_failed;

	if ((rc = determine_role(mbx_sel_obj.rmv_obj)) == NCSCC_RC_FAILURE)
		goto init_failed;

	/* If AMF started register immediately */
	if (!rde_cb->rde_amf_cb.nid_started &&
		(rc = rde_amf_init(&rde_cb->rde_amf_cb)) != NCSCC_RC_SUCCESS) {
		goto init_failed;
	}

	if (rde_cb->rde_amf_cb.nid_started &&
		nid_notify("RDE", rc, NULL) != NCSCC_RC_SUCCESS) {
		LOG_ER("nid_notify failed");
		goto done;
	}

	daemon_sigterm_install(&term_fd);

	fds[FD_TERM].fd = term_fd;
	fds[FD_TERM].events = POLLIN;

	/* USR1/AMF fd */
	fds[FD_AMF].fd = rde_cb->rde_amf_cb.nid_started ?
		usr1_sel_obj.rmv_obj : rde_cb->rde_amf_cb.amf_fd;
	fds[FD_AMF].events = POLLIN;

	/* Mailbox */
	fds[FD_MBX].fd = mbx_sel_obj.rmv_obj;
	fds[FD_MBX].events = POLLIN;

	/* RDA server socket */
	fds[FD_RDA_SERVER].fd = rde_cb->rde_rda_cb.fd;
	fds[FD_RDA_SERVER].events = POLLIN;

	while (1) {
		ret = poll(fds, nfds, -1);

		if (ret == -1) {
			if (errno == EINTR)
				continue;
			
			LOG_ER("poll failed - %s", strerror(errno));
			break;
		}

		if (fds[FD_TERM].revents & POLLIN) {
			daemon_exit();
		}

		if (fds[FD_AMF].revents & POLLIN) {
			if (rde_cb->rde_amf_cb.amf_hdl != 0) {
				SaAisErrorT error;
				TRACE("AMF event rec");
				if ((error = saAmfDispatch(rde_cb->rde_amf_cb.amf_hdl, SA_DISPATCH_ALL)) != SA_AIS_OK) {
					LOG_ER("saAmfDispatch failed: %u", error);
					goto done;
				}
			} else {
				TRACE("SIGUSR1 event rec");
				ncs_sel_obj_destroy(&usr1_sel_obj);
				
				if (rde_amf_init(&rde_cb->rde_amf_cb) != NCSCC_RC_SUCCESS)
					goto done;
				
				fds[FD_AMF].fd = rde_cb->rde_amf_cb.amf_fd;
			}
		}

		if (fds[FD_MBX].revents & POLLIN)
			handle_mbx_event();

		if (fds[FD_RDA_SERVER].revents & POLLIN) {
			int newsockfd;

			newsockfd = accept(rde_rda_cb->fd, (struct sockaddr *)NULL, NULL);
			if (newsockfd < 0) {
				LOG_ER("accept FAILED %s", strerror(errno));
				goto done;
			}

			/* Add the new client fd to client-list	*/
			rde_rda_cb->clients[rde_rda_cb->client_count].is_async = false;
			rde_rda_cb->clients[rde_rda_cb->client_count].fd = newsockfd;
			rde_rda_cb->client_count++;

			/* Update poll fd selection */
			fds[nfds].fd = newsockfd;
			fds[nfds].events = POLLIN;
			nfds++;

			TRACE("accepted new client, fd=%d, idx=%d, nfds=%lu", newsockfd, rde_rda_cb->client_count, nfds);
		}

		for (i = FD_CLIENT_START; i < nfds; i++) {
			if (fds[i].revents & POLLIN) {
				int client_disconnected = 0;
				TRACE("received msg on fd %u", fds[i].fd);
				rde_rda_client_process_msg(rde_rda_cb, fd_to_client_ixd(fds[i].fd), &client_disconnected);
				if (client_disconnected) {
					/* reinitialize the fd array & nfds */
					nfds = FD_CLIENT_START;
					for (i = 0; i < rde_rda_cb->client_count; i++, nfds++) {
						fds[i + FD_CLIENT_START].fd = rde_rda_cb->clients[i].fd;
						fds[i + FD_CLIENT_START].events = POLLIN;
					}
					TRACE("client disconnected, fd array reinitialized, nfds=%lu", nfds);
					break;
				}
			}
		}
	}

 init_failed:
	if (rde_cb->rde_amf_cb.nid_started &&
		nid_notify("RDE", NCSCC_RC_FAILURE, NULL) != NCSCC_RC_SUCCESS) {
		LOG_ER("nid_notify failed");
		rc = NCSCC_RC_FAILURE;
	}

 done:
	syslog(LOG_ERR, "Exiting...");
	exit(1);
}
Example #6
0
/**
 * Forever wait on events and process them.
 */
static void main_process(void)
{
	NCS_SEL_OBJ mbx_fd;
	SaAisErrorT error = SA_AIS_OK;

	TRACE_ENTER();

	/*
	  The initialization of the IMM OM handle below is done to use a feature in the
	  IMM implementation. As long as one handle is initialized, IMM will not release the 
	  MDS subscription just reused it for new handles.
	  When SMF uses SmfImmUtils new handles are created and released during the execution.
	  If the campaign is big the MDS system limit of max number of subscriptions may be exceeded
	  i.e. "ERR    |MDTM: SYSTEM has crossed the max =500 subscriptions"
	  The code below will ensure there is always one IMM OM handle initialized.
	*/
	SaImmHandleT omHandle;
	SaVersionT immVersion = { 'A', 2, 1 };
	SaAisErrorT rc = immutil_saImmOmInitialize(&omHandle, NULL, &immVersion);
	if (rc != SA_AIS_OK) {
		LOG_ER("immutil_saImmOmInitialize faild, rc = %d", rc);
		return;
	}
	/* end of IMM featue code */

	mbx_fd = ncs_ipc_get_sel_obj(&smfd_cb->mbx);

	/* Set up all file descriptors to listen to */
	if (smfd_cb->nid_started)
		fds[SMFD_AMF_FD].fd = smfd_cb->usr1_sel_obj.rmv_obj;
	else
		fds[SMFD_AMF_FD].fd = smfd_cb->amfSelectionObject;

	fds[SMFD_AMF_FD].events = POLLIN;
	fds[SMFD_MBX_FD].fd = mbx_fd.rmv_obj;
	fds[SMFD_MBX_FD].events = POLLIN;
	fds[SMFD_COI_FD].fd = smfd_cb->campaignSelectionObject;
	fds[SMFD_COI_FD].events = POLLIN;

	while (1) {

		if (smfd_cb->campaignOiHandle != 0) {
			fds[SMFD_COI_FD].fd = smfd_cb->campaignSelectionObject;
			fds[SMFD_COI_FD].events = POLLIN;
			nfds = SMFD_MAX_FD;
		} else {
			nfds = SMFD_MAX_FD -1 ;
		}
		
		int ret = poll(fds, nfds, -1);

		if (ret == -1) {
			if (errno == EINTR)
				continue;

			LOG_ER("poll failed - %s", strerror(errno));
			break;
		}

		/* Process all the AMF messages */
		if (fds[SMFD_AMF_FD].revents & POLLIN) {
			if (smfd_cb->amf_hdl != 0) {
				/* dispatch all the AMF pending function */
				if ((error =
				     saAmfDispatch(smfd_cb->amf_hdl,
						   SA_DISPATCH_ALL)) !=
				    SA_AIS_OK) {
					LOG_ER("saAmfDispatch failed: %u",
					       error);
					break;
				}
			} else {
				TRACE("SIGUSR1 event rec");

				if (smfd_amf_init(smfd_cb) != NCSCC_RC_SUCCESS) {
					LOG_ER("init amf failed");
					break;
				}

				TRACE("AMF Initialization SUCCESS......");
				fds[SMFD_AMF_FD].fd =
				    smfd_cb->amfSelectionObject;
			}
		}

		/* Process all the Mail box events */
		if (fds[SMFD_MBX_FD].revents & POLLIN) {
			/* dispatch all the MBX events */
			smfd_process_mbx(&smfd_cb->mbx);
		}

		/* Process all the Imm callback events */
		if (fds[SMFD_COI_FD].revents & POLLIN) {
			if ((error =
			     saImmOiDispatch(smfd_cb->campaignOiHandle,
					     SA_DISPATCH_ALL)) != SA_AIS_OK) {
				/*
				 ** BAD_HANDLE is interpreted as an IMM service restart. Try
				 ** reinitialize the IMM OI API in a background thread and let
				 ** this thread do business as usual especially handling write
				 ** requests.
				 **
				 ** All other errors are treated as non-recoverable (fatal) and will
				 ** cause an exit of the process.
				 */
				if (error == SA_AIS_ERR_BAD_HANDLE) {
					TRACE("main: saImmOiDispatch returned BAD_HANDLE");

					/*
					 ** Invalidate the IMM OI handle, this info is used in other
					 ** locations. E.g. giving TRY_AGAIN responses to a create and
					 ** close app stream requests. That is needed since the IMM OI
					 ** is used in context of these functions.
					 */
					saImmOiFinalize(smfd_cb->campaignOiHandle );
					smfd_cb->campaignOiHandle = 0;

					/* Initiate IMM reinitializtion in the background */
					smfd_coi_reinit_bg(smfd_cb);
					

				} else if (error != SA_AIS_OK) {
					LOG_ER("main: saImmOiDispatch FAILED %u", error);
					break;
				}
			}
		}
	}

	rc = immutil_saImmOmAdminOwnerFinalize(omHandle);
	if (rc != SA_AIS_OK) {
		LOG_ER("immutil_saImmOmAdminOwnerFinalize faild, rc = %d", rc);
	}
}