[CRIU] criu and runc

Adrian Reber adrian at lisas.de
Tue Dec 20 05:32:17 PST 2016


On Fri, Dec 09, 2016 at 06:16:43PM +0100, Adrian Reber wrote:
> On Thu, Dec 08, 2016 at 09:56:34AM -0800, Andrei Vagin wrote:
> > > Now the connections seems to be correctly restored. There seems to be in
> > > a difference where parameters can be specified on the command-line of
> > > runc:
> > > 
> > > I was using:
> > > 
> > >  * runc restore -d rhel7-httpd --tcp-established
> > > 
> > > and the container ID needs the last parameter. So that works:
> > > 
> > >  * runc restore --tcp-established -d rhel7-httpd
> > > 
> > > For 'runc checkpoint' I can specify '--tcp-established' before or after
> > > the container ID. So that is kind of strange. But now it works for me,
> > > that's good for now.
> > 
> > I think we need to fix this in runc or file an issue to runc about
> > this.
> 
> I will look into fixing this.

It seems this cannot be easily fixed. This seems to be short-coming of
the command-line parser:

https://github.com/urfave/cli

runc uses sub-command (like p.haul) and these sub-commands have
additional option. If one of the options like --tcp-established is in
front of the argument (container-id) all options have to be in front of
the argument. The parser cannot handle some options before the argument
and some after the argument.

For the checkpoint I was only using the --tcp-established option and
therefore it could be placed anywhere. For the restore I was using '-d'
for detached and '--tcp-established'. Both parameter need to be either
in front of the container-id or behind the container-id.

Similar issues have already been opened:

https://github.com/urfave/cli/issues/427
https://github.com/urfave/cli/pull/515

The only solution right now seems to re-order the command-line items
before parsing:

https://github.com/ipfs/ipget/pull/41

Not sure if this is necessary for runc.

		Adrian


More information about the CRIU mailing list