Comment 13 for bug 599185

Revision history for this message
Edward DeMeulle (ed-demeulle) wrote :

The problem is the camermonitor doesn't always delete the ~/.cameramonitor.pid file and *sometimes* that PID is in use by another program.

Replacing the following function in /usr/shared/pyshared/cameramonitor/utils.py will fix the problem by checking if the PID that ~/.cameramonitor.pid refers to actually is running cameramonitor:

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