(self, globalCheck=False)
Check if the content of the PID file in /run/...is my PID
Check if the content of the PID file in /run/...is my PID
Check if the content of the PID file in / run / ... is my PID
def isRunning(self, globalCheck=False):
        """Check if the content of the PID file in /run/...is my PID"""
        import psutil
        # Check if the running file is here
        try:
            # Check the cnfiguration specific file first
            if globalCheck:
                fileToCheck = self.globalRunFilePath
            else:
                fileToCheck = self.runFilePath

            with open(fileToCheck) as runFile:
                pid = runFile.read()
                logging.info("Backup is marked as running with pid " + pid)
                if psutil.pid_exists(int(pid)):
                    logging.debug("Process {0} found".format(pid))
                    return True
                logging.warning("Process {0} not found".format(pid))
                return False
        except FileNotFoundError as error:
            return False
def isRunning ( self , globalCheck = False ) : import psutil # Check if the running file is here try : # Check the cnfiguration specific file first if globalCheck : fileToCheck = self . globalRunFilePath else : fileToCheck = self . runFilePath with open ( fileToCheck ) as runFile : pid = runFile . read ( ) logging . info ( "Backup is marked as running with pid " + pid ) if psutil . pid_exists ( int ( pid ) ) : logging . debug ( "Process {0} found" . format ( pid ) ) return True logging . warning ( "Process {0} not found" . format ( pid ) ) return False except FileNotFoundError as error : return False