]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/daemon/cephadmunit: implement kill, wait 1390/head
authorSage Weil <sage@redhat.com>
Mon, 23 Dec 2019 16:35:18 +0000 (16:35 +0000)
committerSage Weil <sage@redhat.com>
Mon, 23 Dec 2019 16:35:52 +0000 (16:35 +0000)
These are both needed by thrashosds.

Signed-off-by: Sage Weil <sage@redhat.com>
teuthology/orchestra/daemon/cephadmunit.py

index 3436c863ef53d23180d6746987234d1a1643d447..b835d7dd546e261c4343752be9954cc453e76e0b 100644 (file)
@@ -33,6 +33,13 @@ class CephadmUnit(DaemonState):
         self.show_cmd = self._get_systemd_cmd('show')
         self.status_cmd = self._get_systemd_cmd('status')
 
+    def kill_cmd(self, sig):
+        return ' '.join([
+            'sudo', 'docker', 'kill',
+            '-s', str(sig),
+            'ceph-%s-%s.%s' % (self.fsid, self.type_, self.id_),
+        ])
+
     def _start_logger(self):
         name = '%s.%s' % (self.type_, self.id_)
         self.remote_logger = self.remote.run(
@@ -92,7 +99,9 @@ class CephadmUnit(DaemonState):
 
         :param sig: signal to send
         """
-        raise NotImplementedError
+        if not silent:
+            self.log.info('Senging signal %d to %s...' % (sig, self.name()))
+        self.remote.sh(self.kill_cmd(sig))
 
     def start(self, timeout=300):
         """
@@ -131,10 +140,13 @@ class CephadmUnit(DaemonState):
         Wait for daemon to stop (but don't trigger the stop).  Pass up
         any exception.  Mark the daemon as not running.
         """
-        raise NotImplementedError
+        self.log.info('Waiting for %s to exit...' % self.name())
+        self._join_logger()
+        self.is_started = False
+        self.log.info('Finished waiting for %s to stop' % self.name())
 
     def wait_for_exit(self):
         """
         clear remote run command value after waiting for exit.
         """
-        raise NotImplementedError
+        self.wait()