'delete pidfile'

def unlink(self):

    try:
        with open(self.fname, 'r') as f:
            pid1 = int((f.read() or 0))
        if (pid1 == self.pid):
            os.unlink(self.fname)
    except:
        pass
