diff options
-rw-r--r-- | daemon/logind/logind.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/daemon/logind/logind.c b/daemon/logind/logind.c index d8220362..91053b9e 100644 --- a/daemon/logind/logind.c +++ b/daemon/logind/logind.c @@ -1338,9 +1338,7 @@ main(int argc, char *argv[]) reload_data(); - event_init(); - signal_set(&ev_sighup, SIGHUP, sighup_cb, &ev_sighup); - signal_add(&ev_sighup, NULL); + struct event_base *evb = event_init(); // bind ports if (port && bind_port(port) < 0) @@ -1379,6 +1377,13 @@ main(int argc, char *argv[]) daemonize(BBSHOME "/run/logind.pid", NULL); } + // Some event notification mechanisms don't work across forks (e.g. kqueue) + event_reinit(evb); + + // SIGHUP handler is reset in daemonize() + signal_set(&ev_sighup, SIGHUP, sighup_cb, &ev_sighup); + signal_add(&ev_sighup, NULL); + // create tunnel if ( (tfd = tobindex(tunnel_path, 1, _set_bind_opt, 1)) < 0) { |