Пример #1
0
/* Reload thread */
static int
reload_vrrp_thread(thread_t * thread)
{
	/* set the reloading flag */
	SET_RELOAD;

	/* Destroy master thread */
	vrrp_dispatcher_release(vrrp_data);
	kernel_netlink_close();
	thread_cleanup_master(master);
#ifdef _HAVE_IPVS_SYNCD_
	/* TODO - Note: this didn't work if we found ipvs_syndc on vrrp before on old_vrrp */
	if (global_data->lvs_syncd_if)
		ipvs_syncd_cmd(IPVS_STOPDAEMON, NULL,
		       (global_data->lvs_syncd_vrrp->state == VRRP_STATE_MAST) ? IPVS_MASTER:
										 IPVS_BACKUP,
		       global_data->lvs_syncd_syncid, false);
#endif
	free_global_data(global_data);
	free_vrrp_buffer();
	gratuitous_arp_close();
	ndisc_close();

#ifdef _WITH_LVS_
	if (vrrp_ipvs_needed()) {
		/* Clean ipvs related */
		ipvs_stop();
	}
#endif

	/* Save previous conf data */
	old_vrrp_data = vrrp_data;
	vrrp_data = NULL;
	reset_interface_queue();

	/* Reload the conf */
#ifdef _DEBUG_
	mem_allocated = 0;
#endif
	start_vrrp();

#ifdef _HAVE_IPVS_SYNCD_
	if (global_data->lvs_syncd_if)
		ipvs_syncd_cmd(IPVS_STARTDAEMON, NULL,
			       (global_data->lvs_syncd_vrrp->state == VRRP_STATE_MAST) ? IPVS_MASTER:
											 IPVS_BACKUP,
			       global_data->lvs_syncd_syncid, false);
#endif

	/* free backup data */
	free_vrrp_data(old_vrrp_data);
	free_old_interface_queue();
	UNSET_RELOAD;

	return 0;
}
Пример #2
0
/* Reload thread */
static int
reload_check_thread(thread_t * thread)
{
	/* set the reloading flag */
	SET_RELOAD;

	log_message(LOG_INFO, "Got SIGHUP, reloading checker configuration");

	/* Destroy master thread */
#ifdef _WITH_VRRP_
	kernel_netlink_close();
#endif
	thread_cleanup_master(master);
	free_global_data(global_data);

	free_checkers_queue();
#ifdef _WITH_VRRP_
	free_interface_queue();
#endif
	free_ssl();
	ipvs_stop();

	/* Save previous conf data */
	old_check_data = check_data;
	check_data = NULL;

	/* Reload the conf */
#ifdef _MEM_CHECK_
	mem_allocated = 0;
#endif
	start_check();

	/* free backup data */
	free_check_data(old_check_data);
	UNSET_RELOAD;

	return 0;
}