From 66a437ca4139431a48168f9b0b1addbc81bec2b7 Mon Sep 17 00:00:00 2001 From: Ivan Suzdal Date: Mon, 30 Jan 2017 15:00:23 +0300 Subject: [PATCH] Fix logrotate postrotate command Change-Id: Ia562039084c23756bf1aa6745e9232f688486087 Closes-Bug: #1656834 --- cobbler.spec | 7 ++++++- cobblerd.logrotate | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 cobblerd.logrotate diff --git a/cobbler.spec b/cobbler.spec index dc573a1..5f07c56 100644 --- a/cobbler.spec +++ b/cobbler.spec @@ -16,8 +16,9 @@ Name: cobbler License: GPLv2+ AutoReq: no Version: 2.6.9 -Release: 1%{?dist}~mos11 +Release: 1%{?dist}~mos12 Source0: https://github.com/cobbler/cobbler/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: cobblerd.logrotate # Support newer virt-install - https://bugzilla.redhat.com/show_bug.cgi?id=1188424 Patch0: cobbler-virtinstall.patch # Support centos release numbering @@ -109,7 +110,11 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT rm $RPM_BUILD_ROOT%{_sysconfdir}/cobbler/cobbler.conf mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d +%if 0%{?rhel} < 7 mv $RPM_BUILD_ROOT%{_sysconfdir}/cobbler/cobblerd_rotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cobblerd +%else +mv %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cobblerd +%endif # Create data directories in tftp_dir mkdir -p $RPM_BUILD_ROOT%{tftp_dir}/{boot,etc,grub,images{,2},ppc,pxelinux.cfg,s390x} diff --git a/cobblerd.logrotate b/cobblerd.logrotate new file mode 100644 index 0000000..453bcc1 --- /dev/null +++ b/cobblerd.logrotate @@ -0,0 +1,26 @@ +/var/log/cobbler/cobbler.log { + missingok + notifempty + rotate 4 + weekly + postrotate + systemctl try-restart cobblerd + endscript +} + +/var/log/cobbler/tasks/*.log { + weekly + rotate 0 + missingok + ifempty + nocompress + nocreate + nomail +} + +/var/log/cobbler/install.log { + missingok + notifempty + rotate 4 + weekly +} -- 2.45.2