Skip to content

Commit

Permalink
Enable CRIU configuration files
Browse files Browse the repository at this point in the history
CRIU 3.11 introduces configuration files:

https://criu.org/Configuration_files
https://lisas.de/~adrian/posts/2018-Nov-08-criu-configuration-files.html

This enables the user to influence CRIU's behaviour without code changes
if using new CRIU features or if the user wants to enable certain CRIU
behaviour without always specifying certain options.

With this it is possible to write 'tcp-established' to the configuration
file:

$ echo tcp-established > /etc/criu/runc.conf

and from now on all checkpoints will preserve the state of established
TCP connections. This removes the need to always use

$ runc checkpoint --tcp-stablished

If the goal is to always checkpoint with '--tcp-established'

It also adds the possibility for unexpected CRIU behaviour if the user
created a configuration file at some point in time and forgets about it.

Signed-off-by: Adrian Reber <[email protected]>
  • Loading branch information
adrianreber committed Nov 16, 2018
1 parent 7fc04fd commit de4d9f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
OrphanPtsMaster: proto.Bool(true),
AutoDedup: proto.Bool(criuOpts.AutoDedup),
LazyPages: proto.Bool(criuOpts.LazyPages),
// CRIU will evaluate a configuration starting with release 3.11.
// Settings in the configuration file will overwrite RPC settings.
ConfigFile: proto.String("/etc/criu/runc.conf"),
}

// If the container is running in a network namespace and has
Expand Down Expand Up @@ -1174,6 +1177,7 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
OrphanPtsMaster: proto.Bool(true),
AutoDedup: proto.Bool(criuOpts.AutoDedup),
LazyPages: proto.Bool(criuOpts.LazyPages),
ConfigFile: proto.String("/etc/criu/runc.conf"),
},
}

Expand Down

0 comments on commit de4d9f1

Please sign in to comment.