d06a0e
From 42c95eacd3eb37f7846967295908fc4a9db81713 Mon Sep 17 00:00:00 2001
d06a0e
From: Kamil Dudka <kdudka@redhat.com>
d06a0e
Date: Tue, 24 Jan 2017 18:26:32 +0100
d06a0e
Subject: [PATCH] Resolves: #1381719 - make /var/lib/logrotate/logrotate.status
d06a0e
 the default state file
d06a0e
d06a0e
---
d06a0e
 config.h                | 2 +-
d06a0e
 examples/logrotate.cron | 2 +-
d06a0e
 logrotate.8             | 5 +++--
d06a0e
 3 files changed, 5 insertions(+), 4 deletions(-)
d06a0e
d06a0e
diff --git a/config.h b/config.h
d06a0e
index d715c5a..31f21aa 100644
d06a0e
--- a/config.h
d06a0e
+++ b/config.h
d06a0e
@@ -43,5 +43,5 @@
d06a0e
 #endif
d06a0e
 
d06a0e
 #ifndef STATEFILE
d06a0e
-#define STATEFILE "/var/lib/logrotate.status"
d06a0e
+#define STATEFILE "/var/lib/logrotate/logrotate.status"
d06a0e
 #endif
eab4a5
diff --git a/examples/logrotate.cron b/examples/logrotate.cron
eab4a5
index c6d50d4..967932e 100644
eab4a5
--- a/examples/logrotate.cron
eab4a5
+++ b/examples/logrotate.cron
eab4a5
@@ -1,6 +1,6 @@
eab4a5
 #!/bin/sh
eab4a5
 
eab4a5
-/usr/sbin/logrotate /etc/logrotate.conf
eab4a5
+/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
eab4a5
 EXITVALUE=$?
eab4a5
 if [ $EXITVALUE != 0 ]; then
eab4a5
     /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
d06a0e
diff --git a/logrotate.8 b/logrotate.8
d06a0e
index 2cd2370..756e655 100644
d06a0e
--- a/logrotate.8
d06a0e
+++ b/logrotate.8
d06a0e
@@ -59,7 +59,8 @@ and mail it to the recipient. The default mail command is \fB/bin/mail
d06a0e
 \fB\-s\fR, \fB\-\-state <statefile>\fR
d06a0e
 Tells \fBlogrotate\fR to use an alternate state file.  This is useful
d06a0e
 if logrotate is being run as a different user for various sets of
d06a0e
-log files.  The default state file is \fI/var/lib/logrotate.status\fR.
d06a0e
+log files.  The default state file is
d06a0e
+\fI/var/lib/logrotate/logrotate.status\fR.
d06a0e
 
d06a0e
 .TP
d06a0e
 \fB\-\-usage\fR
d06a0e
@@ -538,7 +539,7 @@ Log files are rotated if the current year is not the same as the last rotation.
d06a0e
 .SH FILES
d06a0e
 .PD 0
d06a0e
 .TP 27
d06a0e
-\fI/var/lib/logrotate.status\fR
d06a0e
+\fI/var/lib/logrotate/logrotate.status\fR
d06a0e
 Default state file.
d06a0e
 .TP 27
d06a0e
 \fI/etc/logrotate.conf\fR
d06a0e
-- 
d06a0e
2.7.4
d06a0e