From b8ac8ae8c51d7b2a294d1934dfd5fb87e6292dc8 Mon Sep 17 00:00:00 2001
From: Russ Allbery
Date: Sat, 3 Jul 2010 13:11:26 -0700
Subject: [PATCH] Recommend logrotate config name, use missingok
Recommend that files installed in /etc/logrotate.d be named after
the package and use missingok in the example to demonstrate avoiding
errors if the package is removed but not purged.
---
policy.sgml | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/policy.sgml b/policy.sgml
index bad28af..a676e71 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -7868,11 +7868,13 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq
- Log files must be rotated occasionally so that they don't
- grow indefinitely; the best way to do this is to drop a log
- rotation configuration file into the directory
- /etc/logrotate.d and use the facilities provided by
- logrotate.
+ Log files must be rotated occasionally so that they don't grow
+ indefinitely. The best way to do this is to install a log
+ rotation configuration file in the
+ directory /etc/logrotate.d, normally
+ named /etc/logrotate.d/package, and use
+ the facilities provided by logrotate.
+
The traditional approach to log files has been to set up
ad hoc log rotation schemes using simple shell
@@ -7897,25 +7899,28 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq
section="8">):
/var/log/foo/*.log {
-rotate 12
-weekly
-compress
-postrotate
-/etc/init.d/foo force-reload
-endscript
+ rotate 12
+ weekly
+ compress
+ missingok
+ postrotate
+ /etc/init.d/foo force-reload
+ endscript
}
This rotates all files under /var/log/foo, saves 12
compressed generations, and forces the daemon to reload its
- configuration information after the log rotation.
+ configuration information after the log rotation. It skips this
+ log rotation (via missingok) if no such log file is
+ present, which avoids errors if the package is removed but not
+ purged.
- Log files should be removed when the package is
- purged (but not when it is only removed). This should be
- done by the postrm script when it is called
- with the argument purge (see [).
+ Log files should be removed when the package is purged (but not
+ when it is only removed). This should be done by
+ the postrm script when it is called with the
+ argument purge (see ][).
]
--
2.39.5