Slimbook-Team / slimbookamdcontroller

GNU General Public License v3.0
35 stars 8 forks source link

The way you check whether the process is already running seems to fail on some versions of pgrep? #32

Open ldorigo opened 10 months ago

ldorigo commented 10 months ago

You have these lines:

    pgrep = subprocess.getoutput("pgrep slimbookamdcontroller")

    numprocrunning = pgrep.split('\n')

    if len(numprocrunning) > 1:
        print('slimbook amd it is in execution')

I guess this must work for you and you likely have a different version of pgrep than me (pgrep -V says "pgrep from procps-ng 4.0.4 " for me), but pgrep slimbookamdcontroller always outputs:

pgrep: pattern that searches for process name longer than 15 characters will result in zero matches
Try `pgrep -f' option to match against the complete command line. 

Since these are technically two lines of output, they match your if condition and prevent slimbookamdcontroller from running.