:param args: positional arguments passed to remote.run
:param kwargs: keyword arguments passed to remote.run
"""
- self.log.info('Restarting daemon')
- self.log.info("using systemd to restart")
+ self.log.info('Restarting daemon using systemd')
if not self.running():
self.log.info('starting a non-running daemon')
self.remote.run(args=[run.Raw(self.start_cmd)])
:param extra_args: Extra keyword arguments to be added.
"""
- self.log.info('Restarting daemon with args')
- self.log.warn("restart with args not supported with systemd")
+ self.log.warn(
+ "restart_with_args() is not supported with systemd; performing"
+ "normal restart")
self.restart()
def running(self):
:param sig: signal to send
"""
- self.log.info("using systemd to send signal")
- self.log.warn("systemd may restart daemon after kill signal")
+ self.log.warn("systemd may restart daemons automatically")
pid = self.pid
self.log.info("Sending signal %s to process %s", sig, pid)
sig = '-' + str(sig)
self.log.warn('Restarting a running daemon')
self.restart()
return
- self.log.info("using systemd to start")
self.remote.run(args=[run.Raw(self.start_cmd)])
def stop(self, timeout=300):
if not self.running():
self.log.error('tried to stop a non-running daemon')
return
- self.log.info("using systemd to stop")
self.remote.run(args=[run.Raw(self.stop_cmd)])
self.log.info('Stopped')
Wait for daemon to stop (but don't trigger the stop). Pass up
any exception. Mark the daemon as not running.
"""
- self.log.info("Wait not suported in systemd")
+ self.log.error("wait() not suported in systemd")
def wait_for_exit(self):
"""
clear remote run command value after waiting for exit.
"""
# TODO: This ought to be possible, no?
- self.log.error("wait_for_exit is not supported with systemd")
\ No newline at end of file
+ self.log.error("wait_for_exit() is not supported with systemd")
\ No newline at end of file