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 1031832 - corosync-cfgtool -R (reload of corosync.conf) doesn't return status if the config file is invalid
Summary: corosync-cfgtool -R (reload of corosync.conf) doesn't return status if the co...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: corosync
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jan Friesse
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 998883
TreeView+ depends on / blocked
 
Reported: 2013-11-18 22:19 UTC by Chris Feist
Modified: 2014-06-18 00:31 UTC (History)
4 users (show)

Fixed In Version: corosync-2.3.2-3.el7
Doc Type: Bug Fix
Doc Text:
Cause: corosync-cfgtool -R is unsuccessful. Consequence: Return code ($?) is 0. Fix: Properly set return code if failure happens. Result: Unsuccessful corosync-cfgtool -R returns code != 0.
Clone Of:
Environment:
Last Closed: 2014-06-13 12:10:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch - return error on reload failure (1.71 KB, patch)
2013-11-19 14:34 UTC, Jan Friesse
no flags Details | Diff
Proposed patch take 2 - return error on reload failure (1.77 KB, patch)
2013-11-26 14:43 UTC, Jan Friesse
no flags Details | Diff

Description Chris Feist 2013-11-18 22:19:19 UTC
We're using 'corosync-cfgtool -R' inside of pcs to reload the corosync.conf file, but if we try to load a bad corosync.conf 'corosync-cfgtool -R' doesn't let us know.  It looks like the only way we can tell of the reload fails is if we look in the system logs.

Is it possible to have corosync-cfgtool -R provide different output if the reload fails?  If not, then we can just close this bug.

Comment 2 Jan Friesse 2013-11-19 14:21:18 UTC
Chris,
I'm was trying this:
- Exec corosync
- edit corosync.conf and put "}" line on first line of config file (this is invalid because there is no preceding start of section)
- corosync-cfgtool -R ->

Reloading corosync.conf...
Could not reload configuration 2

and "echo $?" == 0

The return code is definitively problem and should be fixed. But even without this fix, corosync-cfgtool -R output is parseable so there is really no need to watch logs. Or do I missing something?

In short. Is proper return code (> 0) enough to fix this BZ or something more is needed?

Comment 3 Jan Friesse 2013-11-19 14:34:51 UTC
Created attachment 826082 [details]
Proposed patch - return error on reload failure

Comment 4 Jan Friesse 2013-11-26 14:43:25 UTC
Created attachment 829309 [details]
Proposed patch take 2 - return error on reload failure

Comment 5 Chris Feist 2013-12-03 00:15:22 UTC
Jan,

I was just adding garbage at the beginning of the file, but it looks like corosync ignores that (which is why I didn't see an error message).  I tried adding garbage to the middle of the file and I saw the error message.

A return code > 0 would work perfectly for me (then I don't need to worry if the error message ever changes).

Your patch looks like it does exactly what I need.

Comment 6 Jan Friesse 2013-12-04 10:09:20 UTC
(In reply to Chris Feist from comment #5)
> Jan,
> 
> I was just adding garbage at the beginning of the file, but it looks like
> corosync ignores that (which is why I didn't see an error message).  I tried
> adding garbage to the middle of the file and I saw the error message.
> 
> A return code > 0 would work perfectly for me (then I don't need to worry if
> the error message ever changes).
> 
> Your patch looks like it does exactly what I need.

Ok, cool.

Comment 10 Ludek Smid 2014-06-13 12:10:45 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.