コード例 #1
0
ファイル: sm_sysvinit.py プロジェクト: bijanz/ajenti
    def get_all(self):
        r = []

        found_names = []

        for line in subprocess_check_output_background(['service', '--status-all']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[3]
            status = tokens[1]
            if status == '?':
                continue

            s = SysVInitService(name)
            found_names.append(name)
            s.running = status == '+'
            r.append(s)

        for line in subprocess_check_output_background(['initctl', 'list']).splitlines():
            tokens = line.split()
            name = tokens[0]
            if name in found_names:
                continue

            for token in tokens:
                if '/' in token:
                    s = SysVInitService(name)
                    s.running = token == 'start/running'
                    r.append(s)

        return r
コード例 #2
0
    def get_all(self):
        r = []

        found_names = []

        for line in subprocess_check_output_background(
            ['service', '--status-all']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[3]
            status = tokens[1]
            if status == '?':
                continue

            s = SysVInitService(name)
            found_names.append(name)
            s.running = status == '+'
            r.append(s)

        for line in subprocess_check_output_background(['initctl',
                                                        'list']).splitlines():
            tokens = line.split()
            name = tokens[0]
            if name in found_names:
                continue

            for token in tokens:
                if '/' in token:
                    s = SysVInitService(name)
                    s.running = token == 'start/running'
                    r.append(s)

        return r
コード例 #3
0
    def get_all(self):
        r = []
        pending = {}
        for line in subprocess_check_output_background(['chkconfig', '--list']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[0]
            s = SysVInitService(name)
            s.refresh()
            r.append(s)

        return r
コード例 #4
0
ファイル: sm_sysvinit.py プロジェクト: RaptorNode/ajenti
    def get_all(self):
        r = []
        for line in subprocess_check_output_background(["service", "--status-all"]).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[3]
            status = tokens[1]
            if status == "?":
                continue

            s = SysVInitService(name)
            s.running = status == "+"
            r.append(s)
        return r
コード例 #5
0
ファイル: sm_centos.py プロジェクト: Bludge0n/ajenti
    def get_all(self):
        r = []
        pending = {}
        for line in subprocess_check_output_background(['chkconfig', '--list']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[0]
            s = SysVInitService(name)
            pending[s] = s._begin_refresh()
            r.append(s)

        for s, v in pending.iteritems():
            s._end_refresh(v)
        return r
コード例 #6
0
    def get_all(self):
        r = []
        for line in subprocess_check_output_background(
            ['service', '--status-all']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[3]
            status = tokens[1]
            if status == '?':
                continue

            s = SysVInitService(name)
            s.running = status == '+'
            r.append(s)
        return r
コード例 #7
0
    def get_all(self):
        r = []
        pending = {}
        for line in subprocess_check_output_background(['chkconfig', '--list'
                                                        ]).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[0]
            s = SysVInitService(name)
            pending[s] = s._begin_refresh()
            r.append(s)

        for s, v in pending.iteritems():
            s._end_refresh(v)
        return r
コード例 #8
0
ファイル: sm_sysvinit.py プロジェクト: AojiaoZero/ajenti
    def get_all(self):
        r = []
        found_names = []

        for line in subprocess_check_output_background(['service', '--status-all']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[3]
            status = tokens[1]
            if status == '?':
                continue

            if name in found_names:
                continue

            s = SysVInitService(name)
            s.running = status == '+'
            r.append(s)

        return r
コード例 #9
0
ファイル: client.py プロジェクト: surjit/ajenti_cp
 def run(self, *cmds):
     return subprocess_check_output_background(['supervisorctl'] +
                                               list(cmds))
コード例 #10
0
ファイル: client.py プロジェクト: AojiaoZero/ajenti
 def run(self, *cmds):
     return subprocess_check_output_background(['supervisorctl'] + list(cmds))