Logo Search packages:      
Sourcecode: jobservice version File versions  Download package

def JobService::backends::sysv::ServiceBackend::_get_lsb_properties (   self,
  name 
) [private]
Scan a service's init.d entry for LSB information about it.
Returns a dictionary of the entries provided.

Definition at line 175 of file sysv.py.

                                       :
        """
        Scan a service's init.d entry for LSB information about it.
        Returns a dictionary of the entries provided.
        """
        props = {'file': '/etc/init.d/' + name}
        try:
            entry = open(props['file'])
        except IOError: return props
        parsing = False
        for line in entry:
            if not parsing:
                if '### BEGIN INIT INFO' in line:
                    parsing = True
                continue
            if '### END INIT INFO' in line:
                break
            try:
                key, value = line[2:].split(': ')
            except: continue
            props[key] = value.strip()
        entry.close()
        return props

Generated by  Doxygen 1.6.0   Back to index