Lines 49-55
class Service(uit.LocalizedDictionary):
|
Link Here
|
---|
|
49 |
""" |
49 |
""" |
50 |
|
50 |
|
51 |
REQUIRED = frozenset(('description', 'programs')) |
51 |
REQUIRED = frozenset(('description', 'programs')) |
52 |
OPTIONAL = frozenset(('start_type', 'systemd', 'icon', 'name', 'init_script')) |
52 |
OPTIONAL = frozenset(('start_type', 'systemd', 'icon', 'name', 'init_script', 'use_systemd_status')) |
53 |
KNOWN = REQUIRED | OPTIONAL |
53 |
KNOWN = REQUIRED | OPTIONAL |
54 |
|
54 |
|
55 |
def __init__(self, *args, **kwargs): |
55 |
def __init__(self, *args, **kwargs): |
Lines 69-81
class Service(uit.LocalizedDictionary):
|
Link Here
|
---|
|
69 |
return incomplete + unknown |
69 |
return incomplete + unknown |
70 |
|
70 |
|
71 |
def _update_status(self): |
71 |
def _update_status(self): |
72 |
for prog in self['programs'].split(','): |
72 |
if self.get('use_systemd_status') and self['use_systemd_status'] == 'True': |
73 |
prog = prog.strip() |
73 |
if self._exec(['systemctl', 'is-active', self['systemd']])[1] == 'active': |
74 |
if prog and not pidof(prog): |
74 |
self.running = True |
|
|
75 |
else: |
75 |
self.running = False |
76 |
self.running = False |
76 |
break |
|
|
77 |
else: |
77 |
else: |
78 |
self.running = True |
78 |
for prog in self['programs'].split(','): |
|
|
79 |
prog = prog.strip() |
80 |
if prog and not pidof(prog): |
81 |
self.running = False |
82 |
break |
83 |
else: |
84 |
self.running = True |
79 |
|
85 |
|
80 |
def start(self): |
86 |
def start(self): |
81 |
"""Start the service.""" |
87 |
"""Start the service.""" |