#include <sys/wait.h>
#include <systemd/sd-event.h>
+#include <systemd/sd-daemon.h>
+
+#include <afb/afb-binding.h>
#include "afb-config.h"
#include "afb-hswitch.h"
#include "verbose.h"
#include "afb-common.h"
#include "afb-hook.h"
-
-#include <afb/afb-binding.h>
+#include "sd-fds.h"
/*
if SELF_PGROUP == 0 the launched command is the group leader
LOGAUTH("afb-daemon");
+ sd_fds_init();
+
// ------------- Build session handler & init config -------
config = afb_config_parse_arguments(argc, argv);
atexit(exit_handler);
exit(1);
}
- afb_session_init(config->nbSessionMax, config->cntxTimeout, config->token, afb_apis_count());
-
afb_api_so_set_timeout(config->apiTimeout);
start_list(config->dbus_clients, afb_api_dbus_add_client, "the afb-dbus client");
start_list(config->ws_clients, afb_api_ws_add_client, "the afb-websocket client");
start_list(config->ldpaths, afb_api_so_add_pathset, "the binding path set");
start_list(config->so_bindings, afb_api_so_add_binding, "the binding");
+
+ afb_session_init(config->nbSessionMax, config->cntxTimeout, config->token, afb_apis_count());
+
start_list(config->dbus_servers, afb_api_dbus_add_server, "the afb-dbus service");
start_list(config->ws_servers, afb_api_ws_add_server, "the afb-websocket service");
// infinite loop
eventloop = afb_common_get_event_loop();
+ sd_notify(1, "READY=1");
for (;;)
sd_event_run(eventloop, 30000000);