From: Patrick Donnelly Date: Tue, 7 Jun 2016 20:20:27 +0000 (-0400) Subject: vstart_runner: only kill/look at user's processes X-Git-Tag: v11.1.1~58^2^2~180^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1675a47d0f5961d087703913efead0ac9445d737;p=ceph.git vstart_runner: only kill/look at user's processes This prevents vstart_runner.py from trying to kill other user's ceph-mds/ceph-fuse instances. --- diff --git a/tasks/cephfs/vstart_runner.py b/tasks/cephfs/vstart_runner.py index eb04bf2b2e9..5d1b77b2797 100644 --- a/tasks/cephfs/vstart_runner.py +++ b/tasks/cephfs/vstart_runner.py @@ -257,14 +257,14 @@ class LocalDaemon(object): Return PID as an integer or None if not found """ ps_txt = self.controller.run( - args=["ps", "aux"] + args=["ps", "-u"+str(os.getuid())] ).stdout.getvalue().strip() lines = ps_txt.split("\n")[1:] for line in lines: if line.find("ceph-{0} -i {1}".format(self.daemon_type, self.daemon_id)) != -1: log.info("Found ps line for daemon: {0}".format(line)) - return int(line.split()[1]) + return int(line.split()[0]) return None @@ -684,13 +684,13 @@ def exec_test(): # Tolerate no MDSs or clients running at start ps_txt = remote.run( - args=["ps", "aux"] + args=["ps", "-u"+str(os.getuid())] ).stdout.getvalue().strip() lines = ps_txt.split("\n")[1:] for line in lines: if 'ceph-fuse' in line or 'ceph-mds' in line: - pid = int(line.split()[1]) + pid = int(line.split()[0]) log.warn("Killing stray process {0}".format(line)) os.kill(pid, signal.SIGKILL)