mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
unbound-dhcp-leases-bridge: Don't open stderr on daemonization
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
f961135513
commit
1918174dbb
@@ -618,13 +618,14 @@ if __name__ == "__main__":
|
||||
bridge = UnboundDHCPLeasesBridge(args.dhcp_leases, args.fix_leases,
|
||||
args.unbound_leases, args.hosts)
|
||||
|
||||
ctx = daemon.DaemonContext(detach_process=args.daemon, stderr=sys.stderr)
|
||||
ctx.signal_map = {
|
||||
signal.SIGHUP : bridge.update_dhcp_leases,
|
||||
signal.SIGTERM : bridge.terminate,
|
||||
}
|
||||
|
||||
with ctx:
|
||||
with daemon.DaemonContext(
|
||||
detach_process=args.daemon,
|
||||
stderr=None if args.daemon else sys.stderr,
|
||||
signal_map = {
|
||||
signal.SIGHUP : bridge.update_dhcp_leases,
|
||||
signal.SIGTERM : bridge.terminate,
|
||||
},
|
||||
) as daemon:
|
||||
setup_logging(daemon=args.daemon, loglevel=loglevel)
|
||||
|
||||
bridge.run()
|
||||
|
||||
Reference in New Issue
Block a user