Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1013135

Summary: logconv.pl tool removes the access logs contents if "-M" is not correctly used
Product: Red Hat Enterprise Linux 6 Reporter: Rich Megginson <rmeggins>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Sankar Ramalingam <sramling>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: jgalipea, nhosoi, nkinder, srkrishn
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.11.15-34.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:50:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1061410    

Description Rich Megginson 2013-09-27 21:52:03 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/471

https://bugzilla.redhat.com/show_bug.cgi?id=838656 (''Red Hat Enterprise Linux 7'')

{{{
Description of problem:
     Running logconv.pl tool with -m or -M option without specifying the
stats.out file, leads to removal of the access logs file contents. This option
is recently introduced to generate Minute/Second based statitics for the ldap
operations.

Version-Release number of selected component (if applicable):
389-ds-base-1.2.10.2-20

How reproducible: Consistently

Steps to Reproduce:
1. Install 389-ds-base latest packages on rhel6.
2. Run logconv.pl tool with -M option.
First, run "ls -l /var/log/dirsrv/slapd-inst/access" to check the size of the
file.
/usr/bin/logconv.pl -M /var/log/dirsrv/slapd-inst/access > /tmp/logconv.out

It generates output as - Illegal division by zero at /usr/bin/logconv.pl line
517

Also, it removes the contents of access logs. Check the file size now.

Actual results: Improper usages of command leads to removal of file contents.

Expected results: Improper usage should give an error message and it should
print the help.

Additional info: Correct usage of the command.
logcov.pl -M /tmp/min_stats.out /var/log/dirsrv/slapd-inst/access
}}}

USCBP would like this in rhel 6.5

Comment 3 srkrishn@redhat.com 2014-07-18 07:46:55 UTC
this bug has been verified as shown below:
following the instructions by Rich Megginson, we can see that the access log file is not empty


[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# ls -l /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403 
-rw-------. 1 nobody nobody 282013304 Jul 18 01:51 /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# logconv.pl -M /var/log/dirsrv/slapd-inst/access > /tmp/logconv.out
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# cat /tmp/logconv.out 
Usage error for option -m or -M, either the output file or access log is missing!

Cleaning up temp files...
Done.
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]#  ls -l /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403 
-rw-------. 1 nobody nobody 282013304 Jul 18 01:51 /var/log/dirsrv/slapd-hp-ms-01-c04/access.20140717-022403
[root@hp-ms-01-c04 slapd-hp-ms-01-c04]# 

this was tested on build:1.2.11.15.38-389-ds-base

Comment 4 Sankar Ramalingam 2014-07-23 16:25:16 UTC
Marking the bug as Verified as per previous comment

Comment 5 errata-xmlrpc 2014-10-14 07:50:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1385.html