Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian....@packages.debian.org
Usertags: pu
Control: affects -1 + src:puppetserver
X-Debbugs-Cc: pkg-puppet-de...@alioth-lists.debian.net

[ Reason ]

The cronjob responsible for cleaning up the directory where reports are stored in the puppet-master package was omitted from its successor, puppetserver.

[ Impact ]

This is causing some installations that were upgraded from bullseye to bookworm to break after some time because of the large amounts of reports generated and stored on the Puppet server. An example of this is https://bugs.debian.org/1078911

Generating and storing these reports is enabled by default.

[ Risk ]

Users relying on the current behavior for long-term storage of the reports may suffer from data-loss, but is considered an acceptable trade-off as it will prevent outages from saturated root filesystems.

[ Tests ]

This has been tested in my home-lab Puppet server to work as expected.

[ Checklist ]

   [X] *all* changes are documented in the d/changelog
   [X] I reviewed all changes and I approve them
   [X] attach debdiff against the package in (old)stable
   [X] the issue is verified as fixed in unstable

[ Changes ]

The attached debdiff consists of the addition of a daily cronjob which retrieves the current Puppet setting for "reportdir", and if the directory exists, deletes all contained files older than 30 days. It also removes any empty directory it finds.

A systemd timer unit is not included because Puppet servers are typically not installed on desktop or laptop machines.

In unstable, puppet-agent was simply modifed not to enable reports by default, see https://bugs.debian.org/1080489

Thank you.

-- Jérôme
diff -Nru puppetserver-7.9.5/debian/changelog 
puppetserver-7.9.5/debian/changelog
--- puppetserver-7.9.5/debian/changelog 2023-05-07 11:09:17.000000000 -0400
+++ puppetserver-7.9.5/debian/changelog 2024-09-05 21:30:33.000000000 -0400
@@ -1,3 +1,9 @@
+puppetserver (7.9.5-2+deb12u1) bookworm; urgency=medium
+
+  * ship cronjob to clean up reportdir automatically
+
+ -- Jérôme Charaoui <jer...@riseup.net>  Thu, 05 Sep 2024 21:30:33 -0400
+
 puppetserver (7.9.5-2) unstable; urgency=medium
 
   * abort service start/reload if mainpid dies (Closes: #1032241)
diff -Nru puppetserver-7.9.5/debian/puppetserver.cron.daily 
puppetserver-7.9.5/debian/puppetserver.cron.daily
--- puppetserver-7.9.5/debian/puppetserver.cron.daily   1969-12-31 
19:00:00.000000000 -0500
+++ puppetserver-7.9.5/debian/puppetserver.cron.daily   2024-09-05 
21:30:33.000000000 -0400
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+reportdir="$(puppet config print reportdir)"
+
+if [ -e "$reportdir" ] ; then
+    find "$reportdir" -type f -ctime +30 -delete
+    find "$reportdir" -mindepth 1 -type d -empty -delete
+fi
+
+exit 0

Reply via email to