[asterisk-bugs] [Asterisk 0015667]: LOGGER WARNING : error executing after rotate
Asterisk Bug Tracker
noreply at bugs.digium.com
Mon Aug 17 13:18:45 CDT 2009
A NOTE has been added to this issue.
======================================================================
https://issues.asterisk.org/view.php?id=15667
======================================================================
Reported By: loic
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 15667
Category: Core/General
Reproducibility: always
Severity: minor
Priority: normal
Status: new
Asterisk Version: 1.6.1.2
Regression: No
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2009-08-06 08:36 CDT
Last Modified: 2009-08-17 13:18 CDT
======================================================================
Summary: LOGGER WARNING : error executing after rotate
Description:
When the parameter "exec_after_rotate" is enabled on logger.conf (for
example to execute gzip -9 ${filename}.2 for compresing logs) and I execute
'asterisk -rx "logger rotate" I have this WARNING :
WARNING[23788]: logger.c:581 rotate_file: error executing 'gzip -9
/var/log/asterisk/messages.2' for each log I want to rotate.
However rotate action and gzip compression are well executed.
To avoid that, I saw in logger.c and I found a mistake I think ;) :
if (ast_safe_system(buf) != -1)
{
ast_log(LOG_WARNING, "error executing '%s'\n", buf);
}
It's not good because asterisk.c return -1 exclusively for problems when
executing 'the exec_after_rotate' command.
So, I replaced '!=' by '==' because for me it's the right symbol.
What do you think about that...
======================================================================
----------------------------------------------------------------------
(0109156) svnbot (reporter) - 2009-08-17 13:18
https://issues.asterisk.org/view.php?id=15667#c109156
----------------------------------------------------------------------
Repository: asterisk
Revision: 212574
U trunk/main/logger.c
------------------------------------------------------------------------
r212574 | seanbright | 2009-08-17 13:18:45 -0500 (Mon, 17 Aug 2009) | 8
lines
Correct the return value check for ast_safe_system.
The logic here was reversed as ast_safe_system returns -1 on error and not
on
success. Fix suggested by reporter.
(closes issue https://issues.asterisk.org/view.php?id=15667)
Reported by: loic
------------------------------------------------------------------------
http://svn.digium.com/view/asterisk?view=rev&revision=212574
Issue History
Date Modified Username Field Change
======================================================================
2009-08-17 13:18 svnbot Checkin
2009-08-17 13:18 svnbot Note Added: 0109156
======================================================================
More information about the asterisk-bugs
mailing list