Linux Container Development
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Jianwei Liao <liaotoad1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: stop checkpointed process
Date: Sun, 29 Nov 2009 09:45:35 -0600	[thread overview]
Message-ID: <20091129154535.GA1115@us.ibm.com> (raw)
In-Reply-To: <2f0d4790911261815s6ba92aa1w9dce17b0c582bb62-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Quoting Jianwei Liao (liaotoad1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org):
> hi all,
> I am using ckpt-v18, everything is fine.
> i have read some of the code of ckpt, but i was wondering that where does
> kernel module to stop the checkpointee? (something related to context?) i
> hope you can point me out how to find such stuff.
> Can i use SIGSTOPand SIGCONT to do such things?
> Thank you very much.
> Liao

Userspace should do this in advance by using the freezer cgroup.  So
for instance if you are wanting to checkpoint /usr/bin/myapp, then
one way to do it is:

	(terminal 1)
	mkdir -p /cgroup
	mount -t cgroup -o freezer freezer /cgroup
	mkdir /cgroup/myapp

	(terminal 2)
	echo $$ > /cgroup/myapp/tasks
	/usr/bin/myapp

	(terminal 1)
	echo FROZEN > /cgroup/myapp/freezer.state
	pid=`pidof myapp`
	checkpoint $pid > myapp.ckpt
	echo THAWED > /cgroup/myapp/freezer.state

If the application hasn't been frozen using the freezer cgroup,
then sys_checkpoint() will return -EBUSY.

-serge

      parent reply	other threads:[~2009-11-29 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-27  2:15 stop checkpointed process Jianwei Liao
     [not found] ` <2f0d4790911261815s6ba92aa1w9dce17b0c582bb62-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-29 15:45   ` Serge E. Hallyn [this message]

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=20091129154535.GA1115@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=liaotoad1-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox