[Devel] Re: stop checkpointed process

Serge E. Hallyn serue at us.ibm.com
Sun Nov 29 07:45:35 PST 2009


Quoting Jianwei Liao (liaotoad1 at gmail.com):
> 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
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list