This is to provide a more accurate running command. It can be extended to
provide a "persist" option to restart the service when it's down.
action)
ServiceHandler.__init__(self, **actions)
action)
ServiceHandler.__init__(self, **actions)
+ def handle_timer(self):
+ p = subprocess.Popen(('pgrep', '-f', self._initd_name),
+ stdout=subprocess.PIPE)
+ pid = p.communicate()[0]
+ if p.wait() == 0 and len(pid) > 0:
+ c._service_running = True
+ else:
+ c._service_running = False
+
class TransactionalHandler(Handler):
r"""Handle command transactions providing a commit and rollback commands.
class TransactionalHandler(Handler):
r"""Handle command transactions providing a commit and rollback commands.