Example #1
0
    def get_all(self):
        r = []
        for line in subprocess.check_output(['chkconfig', '--list']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[0]
            s = SysVInitService(name)
            s.refresh()
            r.append(s)
        return r
Example #2
0
    def get_all(self):
        r = []
        for line in subprocess.check_output(['chkconfig',
                                             '--list']).splitlines():
            tokens = line.split()
            if len(tokens) < 3:
                continue

            name = tokens[0]
            s = SysVInitService(name)
            s.refresh()
            r.append(s)
        return r
Example #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)
            pending[s] = s._begin_refresh()
            r.append(s)

        for s, v in pending.iteritems():
            s._end_refresh(v)
        return r
Example #4
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
Example #5
0
 def get_one(self, name):
     s = SysVInitService(name)
     if os.path.exists(s.script):
         s.refresh()
         return s
     return None