From 6fc0a1d6ebafd7a5b691dca038e52480727eecae Mon Sep 17 00:00:00 2001 From: sunilkumarn417 Date: Tue, 5 May 2020 15:30:46 +0530 Subject: [PATCH] updated pid method to retrieve correct daemon process id. Signed-off-by: sunilkumarn417 --- teuthology/orchestra/daemon/systemd.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/teuthology/orchestra/daemon/systemd.py b/teuthology/orchestra/daemon/systemd.py index 56b235b688..c202669fbe 100644 --- a/teuthology/orchestra/daemon/systemd.py +++ b/teuthology/orchestra/daemon/systemd.py @@ -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- -f --cluster ceph --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 " + 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 -- 2.39.5