Message ID | 1461862786-180287-1-git-send-email-nspiridonov@virtuozzo.com |
---|---|
State | Rejected |
Series | "p.haul: fix root_task_pid function for Virtuozzo containers" |
Headers | show |
diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py index 8f33a17..087ea7b 100644 --- a/phaul/p_haul_vz.py +++ b/phaul/p_haul_vz.py @@ -137,10 +137,9 @@ class p_haul_type: req.opts.ghost_limit = 50 << 20 def root_task_pid(self): - # Expect first line of tasks file contain root pid of CT - path = "/sys/fs/cgroup/memory/{0}/tasks".format(self._ctid) - with open(path) as tasks: - pid = tasks.readline() + path = "/var/run/ve/{0}.init.pid".format(self._ctid) + with open(path) as pidfile: + pid = pidfile.read() return int(pid) def get_meta_images(self, path):
Applied
It is incorrect to grab root pid of container from first line of cgroups tasks file; get root pid from pidfile instead. Signed-off-by: Nikita Spiridonov <nspiridonov@virtuozzo.com> --- phaul/p_haul_vz.py | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)