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..1a36a410 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,7 @@ install: build docs install -d -m 0755 $(DESTDIR)$(MANDIR)/man5 install -d -m 0755 $(DESTDIR)$(WWDOCDIR) install -d -m 0755 $(DESTDIR)$(FIREWALLDDIR) + install -d -m 0755 $(DESTDIR)$(LOGROTATEDIR) install -d -m 0755 $(DESTDIR)$(SYSTEMDDIR) install -d -m 0755 $(DESTDIR)$(IPXESOURCE) install -d -m 0755 $(DESTDIR)$(DATADIR)/warewulf @@ -120,6 +121,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/warewulfd.conf $(DESTDIR)$(LOGROTATEDIR)/warewulfd.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/Variables.mk b/Variables.mk index b23f6a11..69f39507 100644 --- a/Variables.mk +++ b/Variables.mk @@ -48,6 +48,7 @@ VARLIST += TFTPDIR FIREWALLDDIR SYSTEMDDIR BASHCOMPDIR DRACUTMODDIR SYSTEMDDIR ?= /usr/lib/systemd/system BASHCOMPDIR ?= /etc/bash_completion.d FIREWALLDDIR ?= /usr/lib/firewalld/services +LOGROTATEDIR ?= /etc/logrotate.d DRACUTMODDIR ?= /usr/lib/dracut/modules.d ifeq ($(OS),suse) TFTPDIR ?= /srv/tftpboot 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..0d61f47b 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -78,6 +78,8 @@ BuildRequires: make BuildRequires: libassuan-devel gpgme-devel %endif +Recommends: logrotate + %description Warewulf is a stateless and diskless container operating system provisioning system for large clusters of bare metal and/or virtual systems. @@ -169,17 +171,22 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %files +%dir %{_sysconfdir}/bash_completion.d +%dir %{_sysconfdir}/logrotate.d + %defattr(-, root, %{wwgroup}) %dir %{_sysconfdir}/warewulf %config(noreplace) %{_sysconfdir}/warewulf/warewulf.conf %config(noreplace) %{_sysconfdir}/warewulf/examples %config(noreplace) %{_sysconfdir}/warewulf/ipxe %config(noreplace) %{_sysconfdir}/warewulf/grub +%config(noreplace) %{_sysconfdir}/logrotate.d/warewulfd.conf %config(noreplace) %attr(0640,-,-) %{_sysconfdir}/warewulf/nodes.conf + %{_sysconfdir}/bash_completion.d/wwctl %dir %{_sharedstatedir}/warewulf -%{_sharedstatedir}/warewulf/chroots +%dir %{_sharedstatedir}/warewulf/chroots %dir %{_sharedstatedir}/warewulf/overlays %dir %{_sharedstatedir}/warewulf/overlays/debug %dir %{_sharedstatedir}/warewulf/overlays/generic