From 1e9343ea6137ad5880db6ebbeba612f73367b4ac Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 4 May 2021 17:43:31 +0200 Subject: [PATCH] Resolves: #1934629 - unify documentation of copy/copytruncate/renamecopy --- 0002-logrotate-3.18.0-copytruncate-doc.patch | 62 ++++++++++++++++++++ logrotate.spec | 4 ++ 2 files changed, 66 insertions(+) create mode 100644 0002-logrotate-3.18.0-copytruncate-doc.patch diff --git a/0002-logrotate-3.18.0-copytruncate-doc.patch b/0002-logrotate-3.18.0-copytruncate-doc.patch new file mode 100644 index 0000000..4c6e482 --- /dev/null +++ b/0002-logrotate-3.18.0-copytruncate-doc.patch @@ -0,0 +1,62 @@ +From 4810afca1223099c1546da8d73d653c0d1eff96e Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Tue, 27 Apr 2021 18:36:30 +0200 +Subject: [PATCH 1/2] logrotate.8: unify documentation of + copy/copytruncate/renamecopy + +Bug: https://bugzilla.redhat.com/1934629 + +Closes: https://github.com/logrotate/logrotate/pull/386 + +Upstream-commit: 6ac9fe5759678b4c2b312eea490ebbae25092213 +Signed-off-by: Kamil Dudka +--- + logrotate.8.in | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/logrotate.8.in b/logrotate.8.in +index f27c279..8064d68 100644 +--- a/logrotate.8.in ++++ b/logrotate.8.in +@@ -411,7 +411,8 @@ Make a copy of the log file, but don't change the original at all. + This option can be used, for instance, to make a snapshot of the current + log file, or when some other utility needs to truncate or parse the file. + When this option is used, the \fBcreate\fR option will have no effect, +-as the old log file stays in place. ++as the old log file stays in place. The \fBcopy\fR option allows storing ++rotated log files on the different devices using \fBolddir\fR directive. + + .TP + \fBnocopy\fR +@@ -427,7 +428,9 @@ and thus might continue writing (appending) to the previous log file forever. + Note that there is a very small time slice between copying the file and + truncating it, so some logging data might be lost. + When this option is used, the \fBcreate\fR option will have no effect, +-as the old log file stays in place. ++as the old log file stays in place. The \fBcopytruncate\fR option allows ++storing rotated log files on the different devices using \fBolddir\fR ++directive. + + .TP + \fBnocopytruncate\fR +@@ -438,9 +441,14 @@ Do not truncate the original log file in place after creating a copy + \fBrenamecopy\fR + Log file is renamed to temporary filename in the same directory by adding + ".tmp" extension to it. After that, \fBpostrotate\fR script is run +-and log file is copied from temporary filename to final filename. This allows +-storing rotated log files on the different devices using \fBolddir\fR +-directive. In the end, temporary filename is removed. ++and log file is copied from temporary filename to final filename. In the end, ++temporary filename is removed. The \fBrenamecopy\fR option allows storing ++rotated log files on the different devices using \fBolddir\fR directive. ++ ++.TP ++\fBnorenamecopy\fR ++Do not rename and copy the original log file ++(this overrides the \fBrenamecopy\fR option). + + .TP + \fBshred\fR +-- +2.30.2 + diff --git a/logrotate.spec b/logrotate.spec index 735cc88..5cfd249 100644 --- a/logrotate.spec +++ b/logrotate.spec @@ -10,6 +10,9 @@ Source1: rwtab # fix resource leaks reported by Coverity Patch: 0001-logrotate-3.18.0-fix-resource-leaks.patch +# unify documentation of copy/copytruncate/renamecopy (#1934629) +Patch: 0002-logrotate-3.18.0-copytruncate-doc.patch + BuildRequires: acl BuildRequires: automake BuildRequires: gcc @@ -111,6 +114,7 @@ fi %changelog * Tue May 04 2021 Kamil Dudka - 3.18.0-4 +- unify documentation of copy/copytruncate/renamecopy (#1934629) - fix resource leaks reported by Coverity * Fri Apr 16 2021 Mohan Boddu - 3.18.0-3