From a88733149dbafbf7ced8748b4e4d409083ccce82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 6 Jan 2019 04:32:32 +0100 Subject: [PATCH] Add logrotate for qubes logs Fixes QubesOS/qubes-issues#3603 --- linux/system-config/Makefile | 3 +++ linux/system-config/logrotate-qubes | 19 +++++++++++++++++++ rpm_spec/core-dom0.spec.in | 1 + 3 files changed, 23 insertions(+) create mode 100644 linux/system-config/logrotate-qubes diff --git a/linux/system-config/Makefile b/linux/system-config/Makefile index cdcf4b48..ee047f12 100644 --- a/linux/system-config/Makefile +++ b/linux/system-config/Makefile @@ -12,3 +12,6 @@ install: install -d $(DESTDIR)/etc/dbus-1/system.d install -m 0644 dbus-org.qubesos.PolicyAgent.conf \ $(DESTDIR)/etc/dbus-1/system.d/org.qubesos.PolicyAgent.conf + install -d $(DESTDIR)/etc/logrotate.d + install -m 0644 logrotate-qubes \ + $(DESTDIR)/etc/logrotate.d/qubes diff --git a/linux/system-config/logrotate-qubes b/linux/system-config/logrotate-qubes new file mode 100644 index 00000000..168a656b --- /dev/null +++ b/linux/system-config/logrotate-qubes @@ -0,0 +1,19 @@ +/var/log/qubes/qmemman.log { + create 0640 root qubes + su root qubes + postrotate + /bin/systemctl restart qubes-qmemman.service >/dev/null 2>/dev/null || true + endscript +} + +/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 { + su root qubes +} diff --git a/rpm_spec/core-dom0.spec.in b/rpm_spec/core-dom0.spec.in index 927166e0..285d2382 100644 --- a/rpm_spec/core-dom0.spec.in +++ b/rpm_spec/core-dom0.spec.in @@ -193,6 +193,7 @@ fi %defattr(-,root,root,-) %config(noreplace) %attr(0664,root,qubes) %{_sysconfdir}/qubes/qmemman.conf %config(noreplace) /etc/dbus-1/system.d/org.qubesos.PolicyAgent.conf +%config(noreplace) /etc/logrotate.d/qubes %attr(770,root,qubes) %dir /etc/qubes/backup /usr/bin/qvm-* /usr/bin/qubes-*