From fbf3e3c0a8937732f7821291e383c627f1b0e205 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 21 Jun 2024 11:08:11 +0200 Subject: [PATCH] Add a logrotate config for warewulfd.log Signed-off-by: Christian Goll --- CHANGELOG.md | 1 + Makefile | 1 + etc/logrotate.d/warewulfd.conf | 11 +++++++++++ warewulf.spec.in | 1 + 4 files changed, 14 insertions(+) create mode 100644 etc/logrotate.d/warewulfd.conf diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e6960e1..feb56611 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Display an error during boot if no container is defined. #1295 - `wwctl conatiner list --kernel` shows the kernel detected for each container. #1283 - `wwctl container list --size` shows the uncompressed size of each container. `--compressed` shows the compressed size, and `--chroot` shows the size of the container source on the server. #954, #1117 +- Add a logrotate config for `warewulfd.log`. #1311 ### Fixed diff --git a/Makefile b/Makefile index 8add7986..ca160a9c 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,7 @@ install: build docs for f in etc/ipxe/*.ipxe; do install -m 0644 $$f $(DESTDIR)$(WWCONFIGDIR)/ipxe/; done install -m 0644 etc/grub/grub.cfg.ww $(DESTDIR)$(WWCONFIGDIR)/grub/grub.cfg.ww install -m 0644 etc/grub/chainload.ww $(DESTDIR)$(WWOVERLAYDIR)/host/rootfs$(TFTPDIR)/warewulf/grub.cfg.ww + install -m 0644 etc/logrotate.d/logrotate.conf $(DESTDIR)$(WWCONFIGDIR)/logrotate.d/logrotate.conf (cd overlays && find * -type f -exec install -D -m 0644 {} $(DESTDIR)$(WWOVERLAYDIR)/{} \;) (cd overlays && find * -type d -exec mkdir -pv $(DESTDIR)$(WWOVERLAYDIR)/{} \;) (cd overlays && find * -type l -exec cp -av {} $(DESTDIR)$(WWOVERLAYDIR)/{} \;) diff --git a/etc/logrotate.d/warewulfd.conf b/etc/logrotate.d/warewulfd.conf new file mode 100644 index 00000000..7d78208e --- /dev/null +++ b/etc/logrotate.d/warewulfd.conf @@ -0,0 +1,11 @@ +/var/log/warewulfd.log { + size 1M + compress + dateext + missingok + nocreate + notifempty + maxage 365 + rotate 99 + copytruncate +} diff --git a/warewulf.spec.in b/warewulf.spec.in index 63a1fddb..ed1a4251 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -175,6 +175,7 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %config(noreplace) %{_sysconfdir}/warewulf/examples %config(noreplace) %{_sysconfdir}/warewulf/ipxe %config(noreplace) %{_sysconfdir}/warewulf/grub +%config(noreplace) %{_sysconfdir}/logrotate.d/warewulf.conf %config(noreplace) %attr(0640,-,-) %{_sysconfdir}/warewulf/nodes.conf %{_sysconfdir}/bash_completion.d/wwctl