killpg(0, SIGTERM);
else if (childpid > 0)
killpg(childpid, SIGTERM);
- exit(0);
}
static void on_sigterm(int signum, siginfo_t *info, void *uctx)
struct afb_session *session;
};
-static void startup_call_reply(struct afb_xreq *xreq, int iserror, struct json_object *obj)
+static void startup_call_reply(struct afb_xreq *xreq, int status, struct json_object *obj)
{
struct startup_req *sreq = CONTAINER_OF_XREQ(struct startup_req, xreq);
- if (!iserror)
+ if (status >= 0)
NOTICE("startup call %s returned %s", sreq->current->value, json_object_get_string(obj));
else {
ERROR("startup call %s ERROR! %s", sreq->current->value, json_object_get_string(obj));
| job for starting the daemon
+--------------------------------------------------------- */
-static void start()
+static void start(int signum)
{
struct afb_hsrv *hsrv;
+ if (signum) {
+ ERROR("start aborted: received signal %s", strsignal(signum));
+ exit(1);
+ }
+
// ------------------ sanity check ----------------------------------------
if (config->httpdPort <= 0) {
ERROR("no port is defined");
afb_hook_create_ditf(NULL, config->traceditf, NULL, NULL);
if (config->tracesvc)
afb_hook_create_svc(NULL, config->tracesvc, NULL, NULL);
+ if (config->traceevt)
+ afb_hook_create_evt(NULL, config->traceevt, NULL, NULL);
/* load bindings */
apiset_start_list(config->dbus_clients, afb_api_dbus_add_client, "the afb-dbus client");