summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch48
-rw-r--r--meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch30
-rw-r--r--meta/recipes-extended/logrotate/logrotate/update-the-manual.patch26
-rw-r--r--meta/recipes-extended/logrotate/logrotate_3.8.8.bb (renamed from meta/recipes-extended/logrotate/logrotate_3.8.9.bb)4
4 files changed, 48 insertions, 60 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
index 15f171ed6f..ce64040d5f 100644
--- a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
+++ b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -1,12 +1,9 @@
1From 68f29ab490cf987aa34b5f4caf1784b58a021308 Mon Sep 17 00:00:00 2001 1Act as the "mv" command when rotate log
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 17 Feb 2015 21:08:07 -0800
4Subject: [PATCH] Act as the "mv" command when rotate log
5 2
6Act as the "mv" command when rotate log, first rename, if failed, then 3Act as the "mv" command when rotate log, first rename, if failed, then
7read and write. 4read and write.
8 5
9Upstream-Status: Pending 6Upstream-Status: Submitted
10 7
11Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 8Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
12--- 9---
@@ -14,10 +11,10 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
14 1 file changed, 56 insertions(+), 9 deletions(-) 11 1 file changed, 56 insertions(+), 9 deletions(-)
15 12
16diff --git a/logrotate.c b/logrotate.c 13diff --git a/logrotate.c b/logrotate.c
17index 05e74c9..616418f 100644 14index 174a26b..b18b629 100644
18--- a/logrotate.c 15--- a/logrotate.c
19+++ b/logrotate.c 16+++ b/logrotate.c
20@@ -1000,6 +1000,53 @@ int findNeedRotating(struct logInfo *log, int logNum, int force) 17@@ -906,6 +906,53 @@ int findNeedRotating(struct logInfo *log, int logNum, int force)
21 return 0; 18 return 0;
22 } 19 }
23 20
@@ -71,7 +68,7 @@ index 05e74c9..616418f 100644
71 int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state, 68 int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
72 struct logNames *rotNames) 69 struct logNames *rotNames)
73 { 70 {
74@@ -1364,15 +1411,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state, 71@@ -1268,15 +1315,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
75 } 72 }
76 73
77 message(MESS_DEBUG, 74 message(MESS_DEBUG,
@@ -90,21 +87,22 @@ index 05e74c9..616418f 100644
90 oldName, newName, strerror(errno)); 87 oldName, newName, strerror(errno));
91 hasErrors = 1; 88 hasErrors = 1;
92 } 89 }
93@@ -1511,10 +1558,10 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state, 90@@ -1408,11 +1455,11 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
94 return 1;
95 } 91 }
96 92 }
97- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum], 93 #endif /* WITH_ACL */
98+ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum], 94- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
99 tmpFilename); 95+ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
100- if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) { 96 rotNames->finalName);
101- message(MESS_ERROR, "failed to rename %s to %s: %s\n", 97 if (!debug && !hasErrors &&
102+ if (!debug && !hasErrors && mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) { 98- rename(log->files[logNum], rotNames->finalName)) {
103+ message(MESS_ERROR, "failed to move %s to %s: %s\n", 99- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
104 log->files[logNum], tmpFilename, 100+ mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
105 strerror(errno)); 101+ message(MESS_ERROR, "failed to move %s to %s: %s\n",
106 if (errno == ENOENT) { 102 log->files[logNum], rotNames->finalName,
107@@ -1912,7 +1959,7 @@ int rotateLogSet(struct logInfo *log, int force) 103 strerror(errno));
104 hasErrors = 1;
105@@ -1775,7 +1822,7 @@ int rotateLogSet(struct logInfo *log, int force)
108 return hasErrors; 106 return hasErrors;
109 } 107 }
110 108
@@ -113,7 +111,7 @@ index 05e74c9..616418f 100644
113 { 111 {
114 struct logState *p; 112 struct logState *p;
115 FILE *f; 113 FILE *f;
116@@ -2076,7 +2123,7 @@ static int writeState(char *stateFilename) 114@@ -1939,7 +1986,7 @@ static int writeState(char *stateFilename)
117 fclose(f); 115 fclose(f);
118 116
119 if (error == 0) { 117 if (error == 0) {
@@ -122,7 +120,7 @@ index 05e74c9..616418f 100644
122 unlink(tmpFilename); 120 unlink(tmpFilename);
123 error = 1; 121 error = 1;
124 message(MESS_ERROR, "error renaming temp state file %s\n", 122 message(MESS_ERROR, "error renaming temp state file %s\n",
125@@ -2362,7 +2409,7 @@ int main(int argc, const char **argv) 123@@ -2223,7 +2270,7 @@ int main(int argc, const char **argv)
126 rc |= rotateLogSet(log, force); 124 rc |= rotateLogSet(log, force);
127 125
128 if (!debug) 126 if (!debug)
@@ -132,5 +130,5 @@ index 05e74c9..616418f 100644
132 return (rc != 0); 130 return (rc != 0);
133 } 131 }
134-- 132--
1351.7.9.5 1331.7.10.4
136 134
diff --git a/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
index 0535a45e08..43ebcffbae 100644
--- a/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
+++ b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
@@ -1,12 +1,9 @@
1From 263212af7b7fe1083f777255d91f029401391e4f Mon Sep 17 00:00:00 2001 1Disable the check for different filesystems
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 17 Feb 2015 21:18:39 -0800
4Subject: [PATCH] Disable the check for different filesystems
5 2
6The logrotate supports rotate log across different filesystems now, so 3The logrotate supports rotate log across different filesystems now, so
7disable the check for different filesystems. 4disable the check for different filesystems.
8 5
9Upstream-Status: Pending 6Upstream-Status: Submitted
10 7
11Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 8Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
12--- 9---
@@ -14,25 +11,24 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
14 1 file changed, 9 deletions(-) 11 1 file changed, 9 deletions(-)
15 12
16diff --git a/config.c b/config.c 13diff --git a/config.c b/config.c
17index dbbf563..64e66f6 100644 14index e0eadb7..c23092f 100644
18--- a/config.c 15--- a/config.c
19+++ b/config.c 16+++ b/config.c
20@@ -1493,15 +1493,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig) 17@@ -1515,15 +1515,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
21 goto error; 18 dirName, strerror(errno));
22 } 19 goto error;
23 } 20 }
24- 21-
25- if (sb.st_dev != sb2.st_dev 22- if (sb.st_dev != sb2.st_dev
26- && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) { 23- && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY))) {
27- message(MESS_ERROR, 24- message(MESS_ERROR,
28- "%s:%d olddir %s and log file %s " 25- "%s:%d olddir %s and log file %s "
29- "are on different devices\n", configFile, 26- "are on different devices\n", configFile,
30- lineNum, newlog->oldDir, newlog->files[i]); 27- lineNum, newlog->oldDir, newlog->files[i]);
31- goto error; 28- goto error;
32- } 29- }
33 } 30 }
34 } 31 }
35 32
36-- 33--
371.7.9.5 341.7.9.5
38
diff --git a/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
index 50d037d5a1..517acdd27e 100644
--- a/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
+++ b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
@@ -1,32 +1,26 @@
1From e0b0fe30e9c49234994a20a86aacfaf80e690087 Mon Sep 17 00:00:00 2001 1Update the manual
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 17 Feb 2015 21:14:37 -0800
4Subject: [PATCH] Update the manual
5 2
6Update the manual for rotating on different filesystems. 3Update the manual for rotating on different filesystems.
7 4
8Upstream-Status: Pending 5Upstream-Status: Submitted
9 6
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 7Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11--- 8---
12 logrotate.8 | 10 ++++------ 9 logrotate.8 | 7 +++----
13 1 file changed, 4 insertions(+), 6 deletions(-) 10 1 files changed, 3 insertions(+), 4 deletions(-)
14 11
15diff --git a/logrotate.8 b/logrotate.8 12diff --git a/logrotate.8 b/logrotate.8
16index e4e5f48..84407d0 100644 13index 8b34167..5f15432 100644
17--- a/logrotate.8 14--- a/logrotate.8
18+++ b/logrotate.8 15+++ b/logrotate.8
19@@ -405,12 +405,10 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option). 16@@ -374,10 +374,9 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option).
20
21 .TP 17 .TP
22 \fBolddir \fIdirectory\fR 18 \fBolddir \fIdirectory\fR
23-Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be 19 Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR
24-on the same physical device as the log file being rotated, unless \fBcopy\fR, 20-must be on the same physical device as the log file being rotated,
25-\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR 21-and is assumed to be relative to the directory holding the log file
26-is assumed to be relative to the directory holding the log file
27-unless an absolute path name is specified. When this option is used all 22-unless an absolute path name is specified. When this option is used all
28-old versions of the log end up in \fIdirectory\fR. This option may be 23-old versions of the log end up in \fIdirectory\fR. This option may be
29+Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR
30+is assumed to be relative to the directory holding the log file unless 24+is assumed to be relative to the directory holding the log file unless
31+an absolute path name is specified. When this option is used all old 25+an absolute path name is specified. When this option is used all old
32+versions of the log end up in \fIdirectory\fR. This option may be 26+versions of the log end up in \fIdirectory\fR. This option may be
@@ -34,5 +28,5 @@ index e4e5f48..84407d0 100644
34 28
35 .TP 29 .TP
36-- 30--
371.7.9.5 311.7.4.1
38 32
diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.9.bb b/meta/recipes-extended/logrotate/logrotate_3.8.8.bb
index 8611a3e8a5..00432dede2 100644
--- a/meta/recipes-extended/logrotate/logrotate_3.8.9.bb
+++ b/meta/recipes-extended/logrotate/logrotate_3.8.8.bb
@@ -16,8 +16,8 @@ SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.g
16 file://disable-check-different-filesystems.patch \ 16 file://disable-check-different-filesystems.patch \
17 " 17 "
18 18
19SRC_URI[md5sum] = "2660f30742da79870d15d042b07829f6" 19SRC_URI[md5sum] = "49846e873dddea15964cd0355b9943ca"
20SRC_URI[sha256sum] = "700ed7ce9072a1cca324779a74797dfaefdae37ac50a817134b947c4ded1dfa7" 20SRC_URI[sha256sum] = "46a1510ef4a1f4359edd5f361112cfd1523942e85ff28e6cbb0c81bad1829d0f"
21 21
22PACKAGECONFIG ?= "\ 22PACKAGECONFIG ?= "\
23 ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \ 23 ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \