parent
c2c8db066e
commit
bb6e73c43e
@ -9,9 +9,6 @@
|
|||||||
/var/log/qubes/qubes.log {
|
/var/log/qubes/qubes.log {
|
||||||
create 0640 root qubes
|
create 0640 root qubes
|
||||||
su root qubes
|
su root qubes
|
||||||
postrotate
|
|
||||||
/bin/systemctl restart qubesd.service >/dev/null 2>/dev/null || true
|
|
||||||
endscript
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/var/log/qubes/vm-*.log {
|
/var/log/qubes/vm-*.log {
|
||||||
|
@ -24,6 +24,7 @@ See also: :py:attr:`qubes.vm.qubesvm.QubesVM.log`
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import logging.handlers
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import fcntl
|
import fcntl
|
||||||
@ -102,7 +103,8 @@ def enable():
|
|||||||
log_path = '/tmp/qubes.log'
|
log_path = '/tmp/qubes.log'
|
||||||
old_umask = os.umask(0o007)
|
old_umask = os.umask(0o007)
|
||||||
try:
|
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.fcntl(handler_log.stream.fileno(),
|
||||||
fcntl.F_SETFD, fcntl.FD_CLOEXEC)
|
fcntl.F_SETFD, fcntl.FD_CLOEXEC)
|
||||||
finally:
|
finally:
|
||||||
@ -136,7 +138,7 @@ def get_vm_logger(vmname):
|
|||||||
return logger
|
return logger
|
||||||
old_umask = os.umask(0o007)
|
old_umask = os.umask(0o007)
|
||||||
try:
|
try:
|
||||||
handler = logging.FileHandler(
|
handler = logging.handlers.WatchedFileHandler(
|
||||||
os.path.join(LOGPATH, 'vm-{}.log'.format(vmname)))
|
os.path.join(LOGPATH, 'vm-{}.log'.format(vmname)))
|
||||||
fcntl.fcntl(handler.stream.fileno(),
|
fcntl.fcntl(handler.stream.fileno(),
|
||||||
fcntl.F_SETFD, fcntl.FD_CLOEXEC)
|
fcntl.F_SETFD, fcntl.FD_CLOEXEC)
|
||||||
|
Loading…
Reference in New Issue
Block a user