[CRIU] Restarting Process in an LXC Container

Tycho Andersen tycho.andersen at canonical.com
Thu Jan 22 09:54:33 PST 2015


On Thu, Jan 22, 2015 at 05:49:50PM +0100, Thouraya TH wrote:
> Yes, it is fine with *ssh* and without *lxc-attach* :)

Right, I guess this is the same problem as in the other thread (i.e.
the dump fails because the attached process is in a different group)?

Tycho

> Thanks a lot :)
> Bests.
> 
> 2015-01-22 17:47 GMT+01:00 Pavel Emelyanov <xemul at parallels.com>:
> 
> > On 01/22/2015 07:41 PM, Thouraya TH wrote:
> > > *Dumping Process* with - s option:
> > >
> > > root at g-9:/home# lxc-checkpoint *-s *-D /home/ImGLXC1Worker -n worker
> > > root at g-9:/home# lxc-ls -f
> > > NAME     STATE    IPV4  IPV6  GROUPS  AUTOSTART
> > > -----------------------------------------------
> > > worker   *STOPPED*  -     -     -       NO
> > >
> > > *I have done this test:*
> > > You have said: "/Check the file contents *after dump* but *before
> > restore*. Does this file exists
> > > at all? Does it contain proper data?/"
> > >
> > > 1) dumping Process with -s option
> > > 2) root at g-9:/home/ImGLXC1Worker1# lxc-start -n worker
> > >     root at g-9:/home/ImGLXC1Worker1# lxc-ls -f
> > > NAME     STATE    IPV4        IPV6  GROUPS  AUTOSTART
> > > -----------------------------------------------------
> > > worker   RUNNING  10.0.3.109  -     -       NO
> > > worker1  STOPPED  -           -     -       NO
> > > root at g-9:/home/ImGLXC1Worker1# ssh ubuntu@$(sudo lxc-info -n worker -H
> > -i)
> > > ..............
> > > ubuntu at worker:/home$ vim results.txt
> > >
> > > *the file exists and contains the proper data.*
> > >
> > > 3) i stopped the container to test the restart:
> > >    root at g-9:/home/ImGLXC1Worker1# lxc-stop -n worker
> > >    root at g-9:/home/ImGLXC1Worker1# lxc-ls -f
> > > NAME     STATE    IPV4  IPV6  GROUPS  AUTOSTART
> > > -----------------------------------------------
> > > worker   STOPPED  -     -     -       NO
> > > worker1  STOPPED  -     -     -       NO
> > >     root at g-9:/home/ImGLXC1Worker1#  *lxc-checkpoint -r* -D
> > /home/ImGLXC1Worker1 -n worker
> > >     root at g-9:/home/ImGLXC1Worker1# ssh ubuntu@$(sudo lxc-info -n worker
> > -H -i)
> > >     ^C
> > >    root at g-9:/home/ImGLXC1Worker1#
> > >    root at g-9:/home/ImGLXC1Worker1# lxc-ls -f
> > >
> > > ^CTraceback (most recent call last):
> > >   File "/usr/bin/lxc-ls", line 432, in <module>
> > >     containers = get_containers(root=True)
> > >   File "/usr/bin/lxc-ls", line 261, in get_containers
> > >     if container.controllable:
> > > KeyboardInterrupt
> > >
> > > *it's blocked!! *
> >
> > This should be forwarded to LXC guys.
> >
> > > *I proceeded as follows and the test process in the container restarts
> > correctly:
> > >
> > > Restart* (after dumping process without starting and stopping the
> > container)
> > >
> > > root at g-9:/home# lxc-checkpoint -r -D /home/ImGLXC1Worker -n worker
> > > root at g-9:/home#  lxc-ls -f
> > > NAME     STATE    IPV4        IPV6  GROUPS  AUTOSTART
> > > -----------------------------------------------------
> > > worker   RUNNING  10.0.3.109  -     -       NO
> > > worker1  STOPPED  -           -     -       NO
> > > root at g-9:/home# ssh ubuntu@$(sudo lxc-info -n worker -H -i)
> > > ..............
> > > ubuntu at worker:/home$ vim results.txt
> > >
> > > i find the old and the new results in the file :)
> >
> > So everything is fine, isn't it?
> >
> > Thanks,
> > Pavel
> >
> >

> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list