Beispiel #1
0
/* VRRP Child respawning thread */
int
vrrp_respawn_thread(thread_t * thread)
{
	pid_t pid;

	/* Fetch thread args */
	pid = THREAD_CHILD_PID(thread);

	/* Restart respawning thread */
	if (thread->type == THREAD_CHILD_TIMEOUT) {
		thread_add_child(master, vrrp_respawn_thread, NULL,
				 pid, RESPAWN_TIMER);
		return 0;
	}

	/* We catch a SIGCHLD, handle it */
	if (!__test_bit(DONT_RESPAWN_BIT, &debug)) {
		log_message(LOG_ALERT, "VRRP child process(%d) died: Respawning", pid);
		start_vrrp_child();
	} else {
		log_message(LOG_ALERT, "VRRP child process(%d) died: Exiting", pid);
		raise(SIGTERM);
	}
	return 0;
}
Beispiel #2
0
/* Daemon init sequence */
static void
start_keepalived(void)
{
#ifdef _WITH_LVS_
	/* start healthchecker child */
	if (__test_bit(DAEMON_CHECKERS, &daemon_mode))
		start_check_child();
#endif
#ifdef _WITH_VRRP_
	/* start vrrp child */
	if (__test_bit(DAEMON_VRRP, &daemon_mode))
		start_vrrp_child();
#endif
}
Beispiel #3
0
/* Daemon init sequence */
static void
start_keepalived(void)
{
#ifdef _WITH_LVS_
	/* start healthchecker child */
	if (daemon_mode & 2 || !daemon_mode)
		start_check_child();
#endif
#ifdef _WITH_VRRP_
	/* start vrrp child */
	if (daemon_mode & 1 || !daemon_mode)
		start_vrrp_child();
#endif
}
Beispiel #4
0
/* VRRP Child respawning thread */
int
vrrp_respawn_thread(thread * thread_obj)
{
	pid_t pid;

	/* Fetch thread args */
	pid = THREAD_CHILD_PID(thread_obj);

	/* Restart respawning thread */
	if (thread_obj->type == THREAD_CHILD_TIMEOUT) {
		thread_add_child(master, vrrp_respawn_thread, NULL,
				 pid, RESPAWN_TIMER);
		return 0;
	}

	/* We catch a SIGCHLD, handle it */
	log_message(LOG_INFO, "VRRP child process(%d) died: Respawning", pid);
	start_vrrp_child();
	return 0;
}