Comment 16 for bug 599185

Revision history for this message
Nick Lib (nikolauslieb) wrote :

Well, that was silly of me... forgot to fix my fix for the fix :S . Here's what I meant to post:

# Check if the process with pid is running
def pid_running(pid):
      if os.path.isdir('/proc/' + str(pid)):
            with open('/proc/' + str(pid) + '/comm') as fd:
                  cmd = fd.read()
                  return cmd.strip() == 'cameramonitor'
      else:
            return False

I also added conversion of "pid" to a string, in case it is ever passed as an integer. Testing this on the interactive prompt worked fine for me.