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 949483

Summary: Improve the script virt-sanlock-clean
Product: Red Hat Enterprise Linux 7 Reporter: Luwen Su <lsu>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, ajia, cwei, dyuan, eblake, mprivozn, mzhan, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.0.5-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:22:22 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 Luwen Su 2013-04-08 09:24:13 UTC
Description of problem:
I'm not sure but doubt that the bash 4.2 change the way that evaluate expression,


LOCKDIR=`augtool print '/files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir'`
if test $? != 0 || "x$LOCKDIR" = "x"   then    
   LOCKDIR="/var/lib/libvirt/sanlock"
fi



Version-Release number of selected component (if applicable):
libvirt-1.0.3-1.el7.x86_64
bash-4.2.45-1.el7.x86_64
sanlock-2.7-2.el7.x86_64
augeas-1.0.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.just run 
#virt-sanlock-clean

2.
"/usr/sbin/virt-sanlock-cleanup: line 14: x: command not found"



Additional info:
In rhel6 , the same script can success excute.

Comment 2 Alex Jia 2013-04-08 09:49:58 UTC
Patch on upstream:
https://www.redhat.com/archives/libvir-list/2013-April/msg00596.html

Comment 3 Michal Privoznik 2013-04-09 13:33:04 UTC
Moving to POST:

commit c3e33e68d9785028d96be42162001d306c9b6915
Author:     Alex Jia <ajia>
AuthorDate: Mon Apr 8 17:41:50 2013 +0800
Commit:     Alex Jia <ajia>
CommitDate: Tue Apr 9 13:01:33 2013 +0800

    sanlock: add missing test command in virt-sanlock-cleanup.in
    
    RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=949483
    
    Signed-off-by: Alex Jia <ajia>

v1.0.4-98-gc3e33e6

Comment 4 Luwen Su 2013-05-08 03:55:26 UTC
Test with 
libvirt-1.0.5-1.el7.x86_64
bash-4.2.45-1.el7.x86_64

Before
LOCKDIR=`augtool print '/files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir'`
if test $? != 0 ||  "x$LOCKDIR" = "x" ; then
  LOCKDIR="/var/lib/libvirt/sanlock"
fi

test1.sh: line 2: x: command not found

Now , add test
LOCKDIR=`augtool print '/files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir'`
if test $? != 0 || test  "x$LOCKDIR" = "x" ; then
  LOCKDIR="/var/lib/libvirt/sanlock"
fi

//no error
#echo $?
0

So set it verify

Comment 5 Ludek Smid 2014-06-13 10:22:22 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.