[Devel] Re: Linux Checkpoint-Restart - v19

Jiro SEKIBA jir at dependable-os.net
Mon Mar 29 01:52:13 PDT 2010


Hi

On 2010/03/25, at 1:47, Serge E. Hallyn wrote:

> Quoting Jiro SEKIBA (jir at dependable-os.net):
>>> If it doesn't work, can you please describe again the exact order of
>>> commands that you use and the reported error(s) ?
>>> 
>> I'll let you know in any cases.
>> 
>> Thank you very much for the advice
> 
> Hi Jiro,
> 
> Can you fetch the latest cr_tests
> 	(git clone git://git.sr71.net/~hallyn/cr_tests)
> 
> and
> 	cd cr_tests; make; cd simple
> 	sh runtests.sh
> 
> and tell me whether the second (restart --self) test succeeds?
> If it fails, can you send me the cr_*/log2 contents?
> 

I've tried on ckpt-v20 and the above test looks OK.
And looks like self_checkpointing is working fine so far.

However, I'm still not able to restart external checkpoint correctly.

Here are the program and scripts I used for the test.
I used user-cr ckpt-v20 branch for checkpoint/restart program.

This time I disconnect the program from tty completely.

----------8<----------8<----------test.c----------8<----------8<----------
#include <stdio.h>
#include <unistd.h>

int main(void)
{
  FILE *fp;
  int i;
  pid_t pid;
  int st;

  if(fork()) {
    return 0;
  } else {
    waitpid(getppid(), &st, NULL);

    close(0);
    close(1);
    close(2);
    setsid();

    if(fork()) {
      return 0;
    } else 
      waitpid(getppid(), &st, NULL);
  }

  //unlink("/tmp/test.out");
  fp = fopen("/tmp/test.out","w");

  for(i=0;i<10;i++) {
    fprintf(fp,"%d\n",i);
    fflush(fp);
    sleep(1);
  }

  fclose(fp);
  return 0;
}
----------8<----------8<----------test.c----------8<----------8<----------

----------8<----------8<----------checkpoint.sh----------8<----------8<----------
#!/bin/sh

CLOG=checkpoint.log
RLOG=restart.log
rm -f $CLOG $RLOG

./test &
sleep 1
PID=$(ps x | grep test | grep -v grep |cut -f 2 -d' ')

sleep 2
echo $PID > /cgroup/0/tasks

echo FROZEN > /cgroup/0/freezer.state
./checkpoint -l $CLOG -v $PID > ckpt.image

mv /tmp/test.out /tmp/test.out.orig
cp /tmp/test.out.orig /tmp/test.out

echo THAWED > /cgroup/0/freezer.state

./restart --pidns -l $RLOG -v -i ckpt.image;
----------8<----------8<----------checkpoint.sh----------8<----------8<----------

When I run the above script, I got following:

# mount -t cgroup -o freezer cgroup /cgroup
# mkdir /cgroup/0
# sh checkpoint.sh
checkpoint id 8
Success

Then, I'm expecting to see number 0 to 9 in /tmp/test.out, but
I only got 0 to 3, which is the state I froze and checkpointed the process.

checkpoint.log and restart.log are empty.
I guess it means the programs worked fine.

I attached the dmesg I got by the single session of the script.
It looks the restart tries to reopen /tmp/test.out.

Could you give me any clues that I should check with?

My environment is Virtualbox VM.
I tried both with VT and without VT.
No virtualbox guest module is installed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmesg.log
Type: application/octet-stream
Size: 193596 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20100329/6ae64b10/attachment.obj>
-------------- next part --------------

-------------- next part --------------
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers


More information about the Devel mailing list