+class RestartHandler(Handler):
+ r"""RestartHandler() -> RestartHandler :: Provides generic restart command.
+
+ This is a helper class to inherit from to automatically add a restart
+ command that first stop the service and then starts it again (using start
+ and stop commands respectively).
+ """
+
+ @handler(u'Restart the service (alias to stop + start).')
+ def restart(self):
+ r"restart() -> None :: Restart the service calling stop() and start()."
+ self.stop()
+ self.start()
+
+class ReloadHandler(Handler):
+ r"""ReloadHandler() -> ReloadHandler :: Provides generic reload command.
+
+ This is a helper class to inherit from to automatically add a reload
+ command that calls restart.
+ """
+
+ @handler(u'Reload the service config (alias to restart).')
+ def reload(self):
+ r"reload() -> None :: Reload the configuration of the service."
+ self.restart()
+