def stopPPPD(self, dev): """ Stop the connection and hangup the modem """ try: f = open("/var/lock/LCK.." + dev, "r") pid = atoi(f.readline()) f.close() except: return "Could not open lockfile" try: os.kill(pid, SIGTERM) except OSError: return "Could not stop the process" return "Killed"
def stopPPPD(self, dev): """ Stop the connection and hangup the modem """ try: f = open("/var/lock/LCK.." + dev, "r") pid = atoi(f.readline()) f.close() except: return _(MSG_ERR_OPENLCKF) try: os.kill(pid, SIGTERM) except OSError: return _(MSG_ERR_STOPPRCS) return _(MSG_KILD)