zabbix-agent2/src/zabbix_server/ha/ha_manager.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_ha_stop                                                      *
 *                                                                            *
 * Purpose: stop  HA manager                                                  *
 *                                                                            *
 * Comments: This function is used to stop HA manager on normal shutdown      *
 *                                                                            *
 ******************************************************************************/
zbx_ha_stop

Purpose: stop  HA manager

Comments: This function is used to stop HA manager on normal shutdown
zbx_ha_stop Purpose : stop HA manager Comments : This function is used to stop HA manager on normal shutdown
int	zbx_ha_stop(char **error)
{
	int	ret = FAIL;
	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
	if (ZBX_THREAD_ERROR == ha_pid)
	{
		ret = SUCCEED;
		goto out;
	}
	if (SUCCEED == ha_send_manager_message(ZBX_IPC_SERVICE_HA_STOP, error))
	{
		if (ZBX_THREAD_ERROR == zbx_thread_wait(ha_pid))
		{
			*error = zbx_dsprintf(NULL, "failed to wait for HA manager to exit: %s", zbx_strerror(errno));
			goto out;
		}
		ret = SUCCEED;
	}
out:
	ha_pid = ZBX_THREAD_ERROR;
	zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%s", __func__, zbx_result_string(ret));
	return ret;
}
int zbx_ha_stop ( char * * error ) { int ret = FAIL ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ ) ; if ( ZBX_THREAD_ERROR == ha_pid ) { ret = SUCCEED ; goto out ; } if ( SUCCEED == ha_send_manager_message ( ZBX_IPC_SERVICE_HA_STOP , error ) ) { if ( ZBX_THREAD_ERROR == zbx_thread_wait ( ha_pid ) ) { * error = zbx_dsprintf ( NULL , " " , zbx_strerror ( errno ) ) ; goto out ; } ret = SUCCEED ; } out : ha_pid = ZBX_THREAD_ERROR ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ , zbx_result_string ( ret ) ) ; return ret ; }
Function: zbx_ha_stop                                                      
                                                                            
 Purpose: stop  HA manager                                                  
                                                                            
 Comments: This function is used to stop HA manager on normal shutdown
Function : zbx_ha_stop Purpose : stop HA manager Comments : This function is used to stop HA manager on normal shutdown