Bug 514260
| Summary: | /etc/init.d/scsi_reserve should produce [FAIL] on failure as it does [ OK ] on success | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Jaroslav Kortus <jkortus> | ||||||
| Component: | cman | Assignee: | Ryan O'Hara <rohara> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | urgent | ||||||||
| Version: | 5.3 | CC: | ccaulfie, cluster-maint, edamato | ||||||
| Target Milestone: | rc | Keywords: | ZStream | ||||||
| Target Release: | 5.5 | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | cman-2.0.115-22.el5 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2010-03-30 08:38:50 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: | 530400 | ||||||||
| Attachments: |
|
||||||||
|
Description
Jaroslav Kortus
2009-07-28 15:33:38 UTC
I'm going to attach a modified scsi_reserve init script that calls 'failure' (from /etc/init.d/functions) instead of 'exit 1'. Can you test this and let me know how it works? Thanks. Created attachment 356076 [details]
Modified scsi_reserve init script.
Here is the modified scsi_reserve init script from the RHEL54 branch.
The supplied script does not stop with failure, it always succeeds. If failure happens it's echoed in red as expected but then it's overriden by [OK] later in the script. The reason is most probably fact that "failure" call does not exit and the exit is commented out. please fix also one typo at line 226, there should be "Restarting" instead of "Retarting". I have a patch that should fix this problem. Thanks for catching this. As part of the fix, I had to move the commands that echo the current operations. For example, "echo -n Starting scsi_reserve:". These are now printed at the beginning of the script. This is needed so that if a failure occurs the output looks correct. Note that I also added code to handle invalid operations, in which can I print out the usage. All places that used to just exit with status 1 will not call failure and echo (for formatting reasons). I've tested this by misconfiguring my cluster.conf, renaming sg_persist such that the binary can't be found, etc. and it appears to work correctly. One other detail -- I had to move the check to verify that sg_persist binary exist to be the first thing we check. Without this, fence_scsi_test will also test is sg_persist binary exists, and if not, print an error to stdout. Moving the check in scsi_reserve will catch the case where sg_persist does not exist before fence_scsi_test has a chance to do the same. Created attachment 364298 [details]
Patch for scsci_reserve to handle failures.
Pushed to RHEL55 branch. commit c4dbd04e08080515c797258f561453acc4bbefb8 Pushed addition fix to call echo after every call to 'failure'. The existing script was missing a few echo calls, which resulted in output being mangled in a few cases. commit bdb05eefde2a1a898f39cfd2165dcb059b8b0c58 An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0266.html |