mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 23:52:05 -04:00
syslog support
This commit is contained in:
parent
73ca2fa486
commit
1fc4929aa6
1 changed files with 15 additions and 3 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <isc/result.h>
|
||||
|
||||
|
|
@ -67,10 +68,23 @@ linux_dropprivs() {
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
setup_syslog(void) {
|
||||
int options;
|
||||
|
||||
options = LOG_PID;
|
||||
#ifdef LOG_NDELAY
|
||||
options |= LOG_NDELAY;
|
||||
#endif
|
||||
|
||||
openlog("named", options, LOG_DAEMON);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
ns_os_init(void) {
|
||||
|
||||
setup_syslog();
|
||||
|
||||
#ifdef HAVE_LINUX_CAPABILITY_H
|
||||
linux_dropprivs();
|
||||
#endif
|
||||
|
|
@ -80,7 +94,5 @@ ns_os_init(void) {
|
|||
|
||||
void
|
||||
ns_os_shutdown(void) {
|
||||
/*
|
||||
* Nothing to do.
|
||||
*/
|
||||
closelog();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue