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 1817555

Summary: Logrotate gives Inconsistent Exit Code.
Product: Red Hat Enterprise Linux 7 Reporter: Husam Ahmed Chaudhary <huchaudh>
Component: logrotateAssignee: Kamil Dudka <kdudka>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.7CC: kdudka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-30 21:17:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Husam Ahmed Chaudhary 2020-03-26 15:02:22 UTC
Description of problem:

When there are some error in configuration of logrotate, it is expected that it give exit code as 1 (for failure) . But in this case logrotate is not behaving as expected.

Version-Release number of selected component (if applicable):
3.8.6-17.el7.x86_64

How reproducible:

Yes, every time

Steps to Reproduce:

1.Add duplicate entries in /etc/logrotate.conf 
2.Execute Logrotate

Actual results:

[root@rhel7u6-4 ~]# logrotate /etc/logrotate.conf
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel7u6-4 ~]# echo $?
1

[root@rhel7u6-4 ~]# logrotate /etc/logrotate.conf
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel7u6-4 ~]# echo $?
0

[root@rhel7u6-4 ~]# logrotate /etc/logrotate.conf
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel7u6-4 ~]# echo $?
0
[root@rhel7u6-4 ~]# logrotate /etc/logrotate.conf
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel7u6-4 ~]# echo $?

Expected results:

Logrotate should give exit code as 1, every time a error in configuration is detected .

Additional info:

Tried the same in RHEL 8 and didn't face this issue in it.

RHEL version : 8.0
Logrotate Version : 3.14.0-3.el8.x86_6 

[root@rhel8-4 ~]# logrotate /etc/logrotate.conf 
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel8-4 ~]# echo $?
1
[root@rhel8-4 ~]# logrotate /etc/logrotate.conf 
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel8-4 ~]# echo $?
1
[root@rhel8-4 ~]# logrotate /etc/logrotate.conf 
error: /etc/logrotate.conf:49 duplicate log entry for /var/log/boot.log
[root@rhel8-4 ~]# echo $?
1

Comment 2 Kamil Dudka 2020-03-26 15:59:10 UTC
> Version-Release number of selected component (if applicable):
> 3.8.6-17.el7.x86_64

Could you please retest it with logrotate-3.8.6-18.el7?

I believe this is already being fixed as bug #1680436.

Comment 3 Husam Ahmed Chaudhary 2020-03-26 16:53:28 UTC
Hello,

The latest available version on RHEL 7.7 is logrotate-3.8.6-17.el7.

From where can I download logrotate-3.8.6-18.el7 ?


-Regards,
Husam Chaudhary