/* Initialize libevent and start the event loop */ void levent_loop(struct lldpd *cfg) { levent_init(cfg); lldpd_loop(cfg); /* libevent loop */ do { if (event_base_got_break(cfg->g_base) || event_base_got_exit(cfg->g_base)) break; #ifdef USE_SNMP if (cfg->g_snmp) { /* We don't use delegated requests (request whose answer is delayed). However, we keep the call here in case we use it some day. We don't call run_alarms() here. We do it on timeout only. */ netsnmp_check_outstanding_agent_requests(); levent_snmp_update(cfg); } #endif } while (event_base_loop(cfg->g_base, EVLOOP_ONCE) == 0); #ifdef USE_SNMP if (cfg->g_snmp) agent_shutdown(); #endif /* USE_SNMP */ }
void test_agent_start_shutdown(void) { lagopus_thread_t *t; lagopus_result_t ret; ret = agent_initialize((void *)dpmgr, &t); TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK, ret); ret = agent_start(); TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK, ret); ret = agent_shutdown(SHUTDOWN_GRACEFULLY); TEST_ASSERT_EQUAL(LAGOPUS_RESULT_OK, ret); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //plugin_reconfigure //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void _restart_specific_systems(void) { //Shutdown specific systems module_shutdown(); variables_shutdown(); control_shutdown(); agent_shutdown(); style_shutdown(); plugin_controls_shutdown(); plugin_agents_shutdown(); //Restart agent and control masters style_startup(); control_startup(); agent_startup(); plugin_controls_startup(); plugin_agents_startup(); module_startup(); variables_startup(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //plugin_shutdown //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void plugin_shutdown(bool save) { message_interpret(globalmodule.actions[MODULE_ACTION_ONUNLOAD], false, &globalmodule); //Save config settings if (save) config_save(config_path_mainscript); //Shutdown the message & dialog system message_shutdown(); dialog_shutdown(); //Shutdown agents and controls variables_shutdown(); module_shutdown(); control_shutdown(); agent_shutdown(); //Shutdown the windowing system window_shutdown(); //Shutdown the style system. style_shutdown(); //Shutdown control types plugin_controls_shutdown(); //Shutdown agents plugin_agents_shutdown(); tooltip_shutdown(); //Shutdown the configuration system config_shutdown(); menu_shutdown(); }