All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
To: Raghu D K <dk.raghu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: Testing Linux-CR -- Some Documentation
Date: Mon, 16 May 2011 08:27:34 -0500	[thread overview]
Message-ID: <20110516132734.GA26650@mail.hallyn.com> (raw)
In-Reply-To: <BANLkTimSFKU8ibjSpQqQ4vHSFoptJorPFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Quoting Raghu D K (dk.raghu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org):
> Hello All,
> 
> I moved  the "#!/bin/sh" to point to "bash" however I still see issues
> in used the "git://www.linux-cr.org/pub/git/tests-cr" scripts.
> Probably I am missing something with my wrong understanding, I am a
> little confused with the usage of user space application "checkpoint"
> and "restart" and the applications in the "test-cr" folder.
> 
> I wrote a sample shell script "my-test.sh" and tried the following
> without much success.
> 
> #!/bin/sh
> #
> #
> #***********************************************************************************
> 
> echo "Incrementing variable ..."
> COUNT=$1
> X=0
> while [ $X -le $COUNT ];
> do
>         X=$(( $X + 1 ))
>         echo "Value of X =" $X
>         sleep 1
> done
> 
> 
> $ cd ~/user-cr
> $ mount -tcgroup -o freezer cgroup /cgroup
> $ mkdir -p /cgroup/1
> $ nsexec -z5000 my-test.sh 100 &
> $ echo 5000 > /cgroup/1/tasks
> $ echo FROZEN > /cgroup/1/freezer.state
> 
> $ checkpoint 5000 > ckpt.image
> 
> This generated a "ckpt.image" file of size 2594550 bytes
> 
> $ ckptinfo -epv ckpt.image
> info: [@8] object   1 HDR_HEADER len 72
> info: [@80] object   4 HDR_BUFFER len 73
> info: [@153] object   4 HDR_BUFFER len 73
> info: [@226] object   4 HDR_BUFFER len 73
> ...
> unexpected end of file (read 0 of 8)
> 
> $ kill -9 5000
> $ echo THAWED > /cgroup/1/freezer.state
> $ ./restart < ckpt.image
> 
> This one shows error "Bad file discriptor", what I am missing ?

First, you can find more information about what went wrong in a
few ways:

  1. add '-l logfile' arguments to checkpoint and restart commands,
     to put more debug messages into 'logfile'  (which must not yet
     exist)
  2. add '-v' argument to checkpoint and restart for debugging
  3. look at /var/log/syslog for lots of error messages, assuming
     you have CONFIG_CHECKPOINT_DEBUG (or whatever that is called)
     set in your kernel
  4. after doing checkpoint, use 'ckptinfo', which came with the
     user-cr programs, to analyze the checkpoint image

I suspect what happened to you, though, is that you left file
descriptors open.  If you look at counterloop/crcounter.c in
the tests, it does 'for i in (1..100) close(i)'.  The problem
with not doing this is that the program you are checkpointing has
inherited file descriptors from its parent task, and, at restart,
it has no way to recreate those.

-serge

  parent reply	other threads:[~2011-05-16 13:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13  5:09 Testing Linux-CR -- Some Documentation Raghu D K
     [not found] ` <BANLkTimjvdKGr_ZKpoozV5JzdbJeSE7PEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-13 11:42   ` Serge E. Hallyn
     [not found]     ` <20110513114245.GA4121-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2011-05-13 14:07       ` Brian Haley
     [not found]         ` <4DCD3B3E.1040704-VXdhtT5mjnY@public.gmane.org>
2011-05-13 14:51           ` Serge Hallyn
     [not found]             ` <20110513145140.GA23848-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2011-05-16 10:34               ` Raghu D K
     [not found]                 ` <BANLkTimSFKU8ibjSpQqQ4vHSFoptJorPFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-16 13:27                   ` Serge E. Hallyn [this message]
     [not found]                     ` <20110516132734.GA26650-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2011-05-18  7:09                       ` Raghu D K
     [not found]                         ` <BANLkTinQhntbVEvNUmdtFQvr04imEvxm9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-18 13:42                           ` Serge Hallyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110516132734.GA26650@mail.hallyn.com \
    --to=serge-a9i7lubdfnhqt0dzr+alfa@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dk.raghu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.