Bug 608887 - fence_scsi overwrites its own logfile
fence_scsi overwrites its own logfile
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: fence-agents (Show other bugs)
6.0
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Ryan O'Hara
Cluster QE
: TestBlocker
: 622872 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-28 16:10 EDT by Ryan O'Hara
Modified: 2010-11-10 17:09 EST (History)
4 users (show)

See Also:
Fixed In Version: fence-agents-3.0.12-8.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 17:09:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix open flag for logfile to avoid truncate. (436 bytes, patch)
2010-06-28 16:14 EDT, Ryan O'Hara
no flags Details | Diff
Fix typo in agent where opens the logfile. (437 bytes, patch)
2010-08-10 12:11 EDT, Ryan O'Hara
no flags Details | Diff

  None (edit)
Description Ryan O'Hara 2010-06-28 16:10:24 EDT
The fence_scsi agent keeps an optional logfile. This file is opened with incorrect flags, and each time the file is opened it is truncated.

If the logfile does not exist, the script should create it and write to it. If the logfile does exist, the script should append to it.
Comment 2 Ryan O'Hara 2010-06-28 16:14:13 EDT
Created attachment 427500 [details]
Fix open flag for logfile to avoid truncate.

This is a very simple fix. The problem was the the script was opening the file with '>' instead of '>>' flag. This patch fixes the problem.
Comment 3 RHEL Product and Program Management 2010-06-28 16:22:52 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 4 Ryan O'Hara 2010-06-28 17:02:45 EDT
Fixed in RHEL6.

commit 3d36ee013e11043800214f400fae6a6bebd2af41
Comment 7 Dean Jansa 2010-08-10 12:07:52 EDT
New build introduces failure:

[root@marathon-01 ~]# fence_scsi
syntax error at /usr/sbin/fence_scsi line 586, near ", >"
Execution of /usr/sbin/fence_scsi aborted due to compilation errors.
[root@marathon-01 ~]# rpm -qf /usr/sbin/fence_scsi
fence-agents-3.0.12-7.el6.x86_64
Comment 8 Ryan O'Hara 2010-08-10 12:09:34 EDT
*** Bug 622872 has been marked as a duplicate of this bug. ***
Comment 9 Ryan O'Hara 2010-08-10 12:11:46 EDT
Created attachment 437938 [details]
Fix typo in agent where opens the logfile.

Fix typo in agent where opens the logfile.

A typo in the script causes open of logfile to fail with syntax error.
Comment 12 Ryan O'Hara 2010-08-10 13:05:41 EDT
Fixed.

RHEL6 - commit fb73a65a93eb6e262e7988b724c0f1feed4beae5
RHEL60 - commit 734c1956e16c5afc6ac5f265e9b3ed396f9e4201
STABLE3 - commit 66fde5c0404772facee6d935e69530603a577f97
Comment 15 Dean Jansa 2010-08-12 16:40:33 EDT
Typo fixed in fence-agents-3.0.12-8.el6, fence_scsi no longer errors out, log file appended not overwritten.
Comment 16 releng-rhel@redhat.com 2010-11-10 17:09:03 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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