Bug 1020392 - Yumex has a false positive detection that it is already running
Summary: Yumex has a false positive detection that it is already running
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: yumex
Version: 19
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Tim Lauridsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-17 15:02 UTC by Edward Kuns
Modified: 2015-02-18 11:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-18 11:14:23 UTC
Type: Bug


Attachments (Terms of Use)

Description Edward Kuns 2013-10-17 15:02:01 UTC
Description of problem:

   When I start yumex, I get the error:  Yum Extender is already started"
   when it is provably NOT running.  I don't always get this immediately after
   logging in, but once I start getting it, I always get it.

Version-Release number of selected component (if applicable):

   yumex-3.0.12-1.fc19.noarch

How reproducible:

   100% once it occurs

Steps to Reproduce:
1.Try to run yumex as myself (not as root).  I haven't tried running as root.
2.
3.

Actual results:

    Yumex doesn't run

Expected results:

    Yumex runs

Additional info:

I looked at the code and did some experimentation.  The problem is a false positive.  Yumex runs this code:

    ps = subprocess.Popen("ps -eaf | grep yumex", shell=True, stdout=subprocess.PIPE)
 
When I get this error, yumex gets two lines with the string "yumex" from the ps -eaf line.  One from the yumex invocation and one from the "grep yumex" request.  The second ilne should be ruled out by this check later in the function:

   for line in output.split('\n'):
        if '/usr/bin/yumex' in line or 'yumex.py' in line:
            cnt += 1
  
however, the "grep yumex" line contains the environment variable _=/usr/bin/yumex which gives a false positive match to the "if".  It appears the _ environment variable contains the name of the previous program that was run.

If I just add a single blank in front of the string '/usr/bin/yumex' (in line 39 of /usr/bin/yumex) then the false positive is avoided and yumex runs.  Whether bash is providing the wrong value for _ or not, this change is logical, correct, and avoids the false positive.  In the "ps -eaf" output, there will always be a blank before a valid instance of /usr/bin/yumex.

Here is the complete function (for context), with only one line changed:


def check_yumex_is_running():
    '''
    Check if other instances of yum is running
    '''
    ps = subprocess.Popen("ps -eaf | grep yumex", shell=True, stdout=subprocess.PIPE)
    output = ps.stdout.read()
    ps.stdout.close()
    ps.wait()
    cnt = 0
    for line in output.split('\n'):
        if ' /usr/bin/yumex' in line or 'yumex.py' in line:
            cnt += 1
    return cnt > 1

Comment 1 Tim Lauridsen 2013-10-20 06:30:41 UTC
Thanks, fixed upstream

Comment 2 Fedora End Of Life 2015-01-09 22:36:12 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2015-02-18 11:14:23 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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