diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 24f9a3ec..3588becb 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -706,6 +706,12 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): self.events_enabled = True self.fire_event('domain-init') + def close(self): + if self._qdb_connection is not None: + self._qdb_connection.close() + self._qdb_connection = None + super().close() + def __hash__(self): return self.qid diff --git a/qubespolicy/cli.py b/qubespolicy/cli.py index c6f5fc16..14359e43 100644 --- a/qubespolicy/cli.py +++ b/qubespolicy/cli.py @@ -69,8 +69,9 @@ def main(args=None): caller_ident = args.process_ident + "," + args.domain + "," + args.domain_id log = logging.getLogger('qubespolicy') log.setLevel(logging.INFO) - handler = logging.handlers.SysLogHandler(address='/dev/log') - log.addHandler(handler) + if not log.handlers: + handler = logging.handlers.SysLogHandler(address='/dev/log') + log.addHandler(handler) log_prefix = 'qrexec: {}: {} -> {}: '.format( args.service_name, args.domain, args.target) try: