/* Use win32 resources and API */
#undef UB_ON_WINDOWS
+/* the SYSLOG_FACILITY to use, default LOG_DAEMON */
+#undef UB_SYSLOG_FACILITY
+
/* default username */
#undef UB_USERNAME
enable_alloc_nonregional
with_pthreads
with_solaris_threads
+with_syslog_facility
with_pyunbound
with_pythonmodule
enable_swig_version_check
--with-pthreads use pthreads library, or --without-pthreads to
disable threading support.
--with-solaris-threads use solaris native thread library.
+ --with-syslog-facility=LOCAL0 - LOCAL7
+ set SYSLOG_FACILITY, default DAEMON
--with-pyunbound build PyUnbound, or --without-pyunbound to skip it.
(default=no)
--with-pythonmodule build Python module, or --without-pythonmodule to
fi # end of non-mingw check of thread libraries
+# Check for SYSLOG_FACILITY
+
+# Check whether --with-syslog-facility was given.
+if test "${with_syslog_facility+set}" = set; then :
+ withval=$with_syslog_facility; UNBOUND_SYSLOG_FACILITY="$withval"
+fi
+
+case "${UNBOUND_SYSLOG_FACILITY}" in
+
+ LOCAL[0-7]) UNBOUND_SYSLOG_FACILITY="LOG_${UNBOUND_SYSLOG_FACILITY}" ;;
+
+ *) UNBOUND_SYSLOG_FACILITY="LOG_DAEMON" ;;
+
+esac
+
+cat >>confdefs.h <<_ACEOF
+#define UB_SYSLOG_FACILITY ${UNBOUND_SYSLOG_FACILITY}
+_ACEOF
+
+
# Check for PyUnbound
# Check whether --with-pyunbound was given.
fi # end of non-mingw check of thread libraries
+# Check for SYSLOG_FACILITY
+AC_ARG_WITH(syslog-facility, AC_HELP_STRING([--with-syslog-facility=LOCAL0 - LOCAL7], [ set SYSLOG_FACILITY, default DAEMON ]),
+ [ UNBOUND_SYSLOG_FACILITY="$withval" ], [])
+case "${UNBOUND_SYSLOG_FACILITY}" in
+
+ LOCAL[[0-7]]) UNBOUND_SYSLOG_FACILITY="LOG_${UNBOUND_SYSLOG_FACILITY}" ;;
+
+ *) UNBOUND_SYSLOG_FACILITY="LOG_DAEMON" ;;
+
+esac
+AC_DEFINE_UNQUOTED(UB_SYSLOG_FACILITY,${UNBOUND_SYSLOG_FACILITY},[the SYSLOG_FACILITY to use, default LOG_DAEMON])
+
# Check for PyUnbound
AC_ARG_WITH(pyunbound,
AC_HELP_STRING([--with-pyunbound],
+9 September 2019: Wouter
+ - Fix #72: configure --with-syslog-facility=LOCAL0-7 with default
+ LOG_DAEMON (as before) can set the syslog facility that the server
+ uses to log messages.
+
4 September 2019: Wouter
- Fix #71: fix openssl error squelch commit compilation error.
if(use_syslog) {
/* do not delay opening until first write, because we may
* chroot and no longer be able to access dev/log and so on */
- openlog(ident, LOG_NDELAY, LOG_DAEMON);
+ /* the facility is LOG_DAEMON by default, but
+ * --with-syslog-facility=LOCAL[0-7] can override it */
+ openlog(ident, LOG_NDELAY, UB_SYSLOG_FACILITY);
logging_to_syslog = 1;
lock_quick_unlock(&log_lock);
return;