unbound: fix deadlock by specifying a pidfile to daemon

This commit is contained in:
Stephan de Wit 2023-01-20 12:52:50 +01:00
parent f60333622a
commit cb510320fa
2 changed files with 3 additions and 3 deletions

View File

@ -179,7 +179,7 @@ class DNSReader:
return True
def run_logger(self):
# override the Daemonize signal handler
# set a signal handler
signal.signal(signal.SIGINT, self._sig)
signal.signal(signal.SIGTERM, self._sig)
@ -213,7 +213,6 @@ def run(pipe, flush_interval):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--pid', help='pid file location', default='/var/run/unbound_logger.pid')
parser.add_argument('--pipe', help='named pipe file location', default='/var/unbound/data/dns_logger')
parser.add_argument('--flush_interval', help='interval to flush to db', default=10)

View File

@ -71,5 +71,6 @@ if [ -n "${DOMAIN}" ]; then
fi
if [ -f /var/unbound/data/stats ]; then
/usr/sbin/daemon -f -S -m 2 -s err -l local4 -T unbound /usr/local/opnsense/scripts/unbound/logger.py
/usr/sbin/daemon -p /var/run/unbound_logger.pid -f -S -m 2 -s err -l local4 \
-T unbound /usr/local/opnsense/scripts/unbound/logger.py
fi