def signal(self, sig, silent=False):
"""
- Send a signal to associated remote commnad
+ Send a signal to associated remote command.
:param sig: signal to send
"""
- self.proc.stdin.write(struct.pack('!b', sig))
- if not silent:
- self.log.info('Sent signal %d', sig)
+ if self.running():
+ self.proc.stdin.write(struct.pack('!b', sig))
+ if not silent:
+ self.log.info('Sent signal %d', sig)
+ else:
+ self.log.info('No such daemon running')
def start(self, timeout=300):
"""