AC_SEARCH_LIBS(event_set, [event])
AC_CHECK_HEADERS([event.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_FUNCS([event_base_free]) # only in libevent 1.2 and later
+ AC_CHECK_FUNCS([event_base_once]) # only in libevent 1.4? and later
else
AC_DEFINE(USE_MINI_EVENT, 1, [Define if you want to use internal select based events])
fi
#define fseeko fseek
#define ftello ftell
#endif /* HAVE_FSEEKO */
+#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
+ /* using version of libevent that is not threadsafe. */
+# define LIBEVENT_SIGNAL_PROBLEM 1
+#endif
#ifndef RAND_MAX
#define RAND_MAX 2147483647
* when multiple signals in quick succession are sent to us. */
static RETSIGTYPE record_sigh(int sig)
{
+#ifdef LIBEVENT_SIGNAL_PROBLEM
+ exit(0);
+#endif
switch(sig)
{
case SIGTERM:
ub_thread_sig_unblock(SIGINT);
ub_thread_sig_unblock(SIGQUIT);
ub_thread_sig_unblock(SIGTERM);
+#ifndef LIBEVENT_SIGNAL_PROBLEM
worker->comsig = comm_signal_create(worker->base,
worker_sighandler, worker);
if(!worker->comsig || !comm_signal_bind(worker->comsig, SIGHUP)
worker_delete(worker);
return 0;
}
+#endif /* LIBEVENT_SIGNAL_PROBLEM */
} else { /* !do_sigs */
worker->comsig = 0;
}
- do not compile fork funcs unless needed. Otherwise will give
type errors as their typedefs have not been enabled.
- log shows thread numbers much more nicely (and portably).
+ - even on systems with nonthreadsafe libevent signal handling,
+ unbound will exit if given a signal.
+ Reloads will not work, and exit is not graceful.
1 March 2007: Wouter
- Signals, libevent and threads work well, with libevent patch and
* run libtoolize -c if config.sub is missing.
* autoreconf (autoheader && autoconf), if ./configure is missing.
+Known issues
+------------
+o If libevent is older (1.3 and before), unbound will exit instead of reload
+ on sighup. On a restart 'did not exit gracefully last time' warning is
+ printed. Perform ./configure --with-libevent=no or update libevent, rerun
+ configure and recompile unbound to make sighup work correctly.
+
* mailto:wouter@nlnetlabs.nl