Exemple #1
0
/**
 * Reload the configuration file for the MaxScale
 *
 * @return A zero return indicates a fatal error reading the configuration
 */
int
config_reload()
{
CONFIG_CONTEXT	config;
int		rval;

	if (!config_file)
		return 0;
	global_defaults();

	config.object = "";
	config.next = NULL;

	if (ini_parse(config_file, handler, &config) < 0)
		return 0;

	rval = process_config_update(config.next);
	free_config_context(config.next);

	return rval;
}
Exemple #2
0
/**
 * Load the configuration file for the MaxScale
 *
 * @param file	The filename of the configuration file
 * @return A zero return indicates a fatal error reading the configuration
 */
int
config_load(char *file)
{
CONFIG_CONTEXT	config;
int		rval;

	global_defaults();

	config.object = "";
	config.next = NULL;

	if (ini_parse(file, handler, &config) < 0)
		return 0;

	config_file = file;

	check_config_objects(config.next);
	rval = process_config_context(config.next);
	free_config_context(config.next);

	return rval;
}
Exemple #3
0
int main(int argc, char *argv[])
{
	int ret;
/* fn pointers */
	gi = &global_info;

	fns_load_defaults();

	debug_trace_init_mandatory();
/* XXX
  debug_trace_init ();
*/

/* XXX
  bot_alloc_on ();
  bot_alloc_verbose_on ();
*/

	srand(getpid());
	SSL_library_init();
	SSL_load_error_strings();
//  OpenSSL_add_all_algorithms ();

	setlocale(LC_ALL, "");

	global_signal_hooks();

	global_defaults();

	global_getopt(argc, argv);

	global_set_proc_ptrs(&argc, argv, environ);

	global_conf_parse();

	if (global_chroot() < 0) {
		debug_err(NULL, "main: bot_chroot: Failed\n");
	}

	global_on();

/*
  event_dispatch ();
*/
	setjmp(gi->sigprotect_buf);
	sigsetjmp(gi->sigprotect_sigbuf, 1);

	while (1) {

/*trying to fix gmod_grelinkd reload */
/*
global_gcmd();
*/

		gi->bot_current = NULL;
		pmodule_cur_clear();
		ret = event_loop(EVLOOP_ONCE);
		if (ret) {
			global_set_evhook_console();
		}

		timer_shouldwerun();

	}

	return 0;
}