[asterisk-bugs] [Asterisk 0015667]: LOGGER WARNING : error executing after rotate
Asterisk Bug Tracker
noreply at bugs.digium.com
Mon Aug 17 13:22:05 CDT 2009
A NOTE has been added to this issue.
======================================================================
https://issues.asterisk.org/view.php?id=15667
======================================================================
Reported By: loic
Assigned To: seanbright
======================================================================
Project: Asterisk
Issue ID: 15667
Category: Core/General
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
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:
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 2009-08-06 08:36 CDT
Last Modified: 2009-08-17 13:22 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...
======================================================================
----------------------------------------------------------------------
(0109157) svnbot (reporter) - 2009-08-17 13:22
https://issues.asterisk.org/view.php?id=15667#c109157
----------------------------------------------------------------------
Repository: asterisk
Revision: 212578
U branches/1.6.0/main/logger.c
------------------------------------------------------------------------
r212578 | seanbright | 2009-08-17 13:22:04 -0500 (Mon, 17 Aug 2009) | 15
lines
Merged revisions 212574 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r212574 | seanbright | 2009-08-17 14:18:16 -0400 (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=212578
Issue History
Date Modified Username Field Change
======================================================================
2009-08-17 13:22 svnbot Checkin
2009-08-17 13:22 svnbot Note Added: 0109157
======================================================================
More information about the asterisk-bugs
mailing list