summaryrefslogtreecommitdiff
path: root/src/manager/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager/main.c')
-rw-r--r--src/manager/main.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/manager/main.c b/src/manager/main.c
index 6fef0bf3e..1f5c45113 100644
--- a/src/manager/main.c
+++ b/src/manager/main.c
@@ -34,10 +34,13 @@ int main (int arc, char *argv[])
bool debug;
int threads, timeout;
- library_init(STRONGSWAN_CONF);
- lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
- lib->settings->get_str(lib->settings, "manager.load", PLUGINS));
-
+ library_init(NULL);
+ if (!lib->plugins->load(lib->plugins, NULL,
+ lib->settings->get_str(lib->settings, "manager.load", PLUGINS)))
+ {
+ return 1;
+ }
+
socket = lib->settings->get_str(lib->settings, "manager.socket", NULL);
debug = lib->settings->get_bool(lib->settings, "manager.debug", FALSE);
timeout = lib->settings->get_time(lib->settings, "manager.timeout", 900);
@@ -48,13 +51,13 @@ int main (int arc, char *argv[])
DBG1("database URI undefined, set manager.database in strongswan.conf");
return 1;
}
-
+
storage = storage_create(database);
if (storage == NULL)
{
return 1;
}
-
+
dispatcher = dispatcher_create(socket, debug, timeout,
(context_constructor_t)manager_create, storage);
dispatcher->add_controller(dispatcher, ikesa_controller_create, NULL);
@@ -62,16 +65,16 @@ int main (int arc, char *argv[])
dispatcher->add_controller(dispatcher, auth_controller_create, NULL);
dispatcher->add_controller(dispatcher, control_controller_create, NULL);
dispatcher->add_controller(dispatcher, config_controller_create, NULL);
-
+
dispatcher->run(dispatcher, threads);
-
+
dispatcher->waitsignal(dispatcher);
-
+
dispatcher->destroy(dispatcher);
storage->destroy(storage);
-
+
library_deinit();
- return 0;
+ return 0;
}