diff --git a/linux/system-config/logrotate-qubes b/linux/system-config/logrotate-qubes index 168a656b..5daf1aeb 100644 --- a/linux/system-config/logrotate-qubes +++ b/linux/system-config/logrotate-qubes @@ -9,9 +9,6 @@ /var/log/qubes/qubes.log { create 0640 root qubes su root qubes - postrotate - /bin/systemctl restart qubesd.service >/dev/null 2>/dev/null || true - endscript } /var/log/qubes/vm-*.log { diff --git a/qubes/log.py b/qubes/log.py index 1bb780f5..b0a4e37e 100644 --- a/qubes/log.py +++ b/qubes/log.py @@ -24,6 +24,7 @@ See also: :py:attr:`qubes.vm.qubesvm.QubesVM.log` ''' import logging +import logging.handlers import os import sys import fcntl @@ -102,7 +103,8 @@ def enable(): log_path = '/tmp/qubes.log' old_umask = os.umask(0o007) try: - handler_log = logging.FileHandler(log_path, 'a', encoding='utf-8') + handler_log = logging.handlers.WatchedFileHandler( + log_path, 'a', encoding='utf-8') fcntl.fcntl(handler_log.stream.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC) finally: @@ -136,7 +138,7 @@ def get_vm_logger(vmname): return logger old_umask = os.umask(0o007) try: - handler = logging.FileHandler( + handler = logging.handlers.WatchedFileHandler( os.path.join(LOGPATH, 'vm-{}.log'.format(vmname))) fcntl.fcntl(handler.stream.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)