コード例 #1
0
ファイル: link.py プロジェクト: blue-devil/kuller
    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"
コード例 #2
0
    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"
コード例 #3
0
ファイル: link.py プロジェクト: pars-linux/corporate2
    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)
コード例 #4
0
ファイル: link.py プロジェクト: ibrahimkaraguzel/kuller
    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)