Commit 1b234fd8 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: show a process tree before and after c/r

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cc97a2d0
......@@ -186,11 +186,15 @@ construct_root()
{
local root=$1
local test_path=$2
local ps_path=`type -P ps`
local libdir=$root/lib
local libdir2=$root/lib64
mkdir $root/bin
cp $ps_path $root/bin
mkdir $libdir $libdir2
for i in `ldd $test_path | awk '{ print $1 }' | grep -v vdso`; do
for i in `ldd $test_path $ps_path | awk '/^\s/{ print $1 }' | grep -v vdso`; do
local lib=`basename $i`
[ -f $libdir/$lib ] && continue ||
[ -f $i ] && cp $i $libdir && cp $i $libdir2 && continue ||
......
......@@ -210,6 +210,13 @@ int ns_init(int argc, char **argv)
ret = 1;
waitpid(pid, &ret, 0);
pid = fork();
if (pid == 0) {
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
} else if (pid > 0)
waitpid(pid, NULL, 0);
/* Daemonize */
write(status_pipe, &ret, sizeof(ret));
close(status_pipe);
......@@ -219,6 +226,12 @@ int ns_init(int argc, char **argv)
/* suspend/resume */
test_waitsig();
pid = fork();
if (pid == 0) {
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
} else if (pid > 0)
waitpid(pid, NULL, 0);
fd = open(pidfile, O_RDONLY);
if (fd == -1) {
fprintf(stderr, "open(%s) failed: %m\n", pidfile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment