Bug 608887 - fence_scsi overwrites its own logfile
Summary: fence_scsi overwrites its own logfile
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: fence-agents   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Ryan O'Hara
QA Contact: Cluster QE
Keywords: TestBlocker
: 622872 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-28 20:10 UTC by Ryan O'Hara
Modified: 2010-11-10 22:09 UTC (History)
4 users (show)

Fixed In Version: fence-agents-3.0.12-8.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-11-10 22:09:03 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 20:14 UTC, Ryan O'Hara
no flags Details | Diff
Fix typo in agent where opens the logfile. (437 bytes, patch)
2010-08-10 16:11 UTC, Ryan O'Hara
no flags Details | Diff

Description Ryan O'Hara 2010-06-28 20:10:24 UTC
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 20:14:13 UTC
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 20:22:52 UTC
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

Comment 4 Ryan O'Hara 2010-06-28 21:02:45 UTC
Fixed in RHEL6.

commit 3d36ee013e11043800214f400fae6a6bebd2af41

Comment 7 Dean Jansa 2010-08-10 16:07:52 UTC
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

Comment 8 Ryan O'Hara 2010-08-10 16:09:34 UTC
*** Bug 622872 has been marked as a duplicate of this bug. ***

Comment 9 Ryan O'Hara 2010-08-10 16:11:46 UTC
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 17:05:41 UTC

RHEL6 - commit fb73a65a93eb6e262e7988b724c0f1feed4beae5
RHEL60 - commit 734c1956e16c5afc6ac5f265e9b3ed396f9e4201
STABLE3 - commit 66fde5c0404772facee6d935e69530603a577f97

Comment 15 Dean Jansa 2010-08-12 20:40:33 UTC
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 22:09:03 UTC
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.