]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
updated pid method to retrieve correct daemon process id. 1464/head
authorsunilkumarn417 <sunnagar@redhat.com>
Tue, 5 May 2020 10:00:46 +0000 (15:30 +0530)
committersunilkumarn417 <sunnagar@redhat.com>
Wed, 6 May 2020 04:36:11 +0000 (10:06 +0530)
Signed-off-by: sunilkumarn417 <sunnagar@redhat.com>
teuthology/orchestra/daemon/systemd.py

index 56b235b688123206272293fd0943c5866c962b5d..c202669fbe2be63c836d1ab581eca909359b0969 100644 (file)
@@ -94,8 +94,20 @@ class SystemDState(DaemonState):
 
     @property
     def pid(self):
+        """
+        Method to retrieve daemon process id
+        """
         proc_name = 'ceph-%s' % self.type_
-        proc_regex = '"%s.*--id %s"' % (proc_name, self.id_)
+
+        # process regex to match OSD, MON, MGR, MDS process command string
+        # eg. "/usr/bin/ceph-<daemon-type> -f --cluster ceph --id <daemon-id>"
+        proc_regex = '"%s.*--id %s "' % (proc_name, self.id_)
+
+        # process regex to match RADOSGW process command string
+        # eg. "/usr/bin/radosgw -f --cluster ceph --name <daemon-id=self.id_>"
+        if self.type_ == "rgw":
+            proc_regex = "{}.* --name .*{}".format(self.daemon_type, self.id_)
+
         args = ['ps', '-ef',
                 run.Raw('|'),
                 'grep',
@@ -110,7 +122,6 @@ class SystemDState(DaemonState):
             return None
         return int(pid_string)
 
-
     def reset(self):
         """
         Does nothing in this implementation