summaryrefslogtreecommitdiffstats
path: root/patches/logrotate-3.7.1/scripterrors.patch
blob: ff1619230a092445ab950b136d0189ed572da9b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Give error messages identifying log file on script errors
(Closes: #122691, #195790, #222050, #306020)

---
 logrotate.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: logrotate-3.7.1/logrotate.c
===================================================================
--- logrotate-3.7.1.orig/logrotate.c
+++ logrotate-3.7.1/logrotate.c
@@ -770,8 +770,8 @@ int rotateSingleLog(logInfo * log, int l
         if (log->pre && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) {
             message(MESS_DEBUG, "running prerotate script\n");
             if (runScript(log->files[logNum], log->pre)) {
-                message(MESS_ERROR, "error running prerotate script, "
-			"leaving old log in place\n");
+                message(MESS_ERROR, "error running prerotate script for %s, "
+			"leaving old log in place\n", log->files[logNum]);
                 hasErrors = 1;
 	    }
         }
@@ -853,7 +853,8 @@ int rotateSingleLog(logInfo * log, int l
 	    !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) {
             message(MESS_DEBUG, "running postrotate script\n");
             if (runScript(log->files[logNum], log->post)) {
-                message(MESS_ERROR, "error running postrotate script\n");
+                message(MESS_ERROR, "error running postrotate script for %s\n",
+			log->files[logNum]);
                 hasErrors = 1;
 	    }
         }