Difference between revisions of "AutoFS"

From CRIU
Jump to: navigation, search
Line 27: Line 27:
 
Can be used something like below
 
Can be used something like below
  
  criu restore ... --action-script systemd-autofs-restart.sh
+
  criu restore ... --action-script /usr/libexec/criu/scripts/systemd-autofs-restart.sh
  
 
It restarts only one service so far: <code>proc-sys-fs-binfmt_misc.automount</code>. But it can be easily extended to support any other.
 
It restarts only one service so far: <code>proc-sys-fs-binfmt_misc.automount</code>. But it can be easily extended to support any other.
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Revision as of 15:58, 22 April 2016

If you have AutoFS mount inside the container, you need to know some tricks.

Requirements

AutoFS migration is supported by CRIU starting from version ...

Another requirement is linux kernel with version 4.6 or higher.

Limitations

CRIU supports both direct (offset) and indirect AutoFS mount points migration.

Howewer, there is a limitation in migrating of systemd services, using AutoFS.

The root of the limitation is that systemd saves AutoFS mount point device ID in its internals and compares saved value with current one on each AutoFS-related request from kernel side, and if they do not match - ignores the request.

CRIU reconstructs AutoFS mount point on restore with different device ID, thus systemd doesn't recognize it anymore.

In user world it means, that any access to AutoFS mount point, served by systemd, will hung. Restart of the service solves this issue.

Tricks

To overcome the limitation above, systemd-autofs-restart.sh action script was introduced. It can be found in scripts directory in CRIU sources.

This script is aimed to be used with CRIU option --action-script on restore to fix the issue for those systemd services, which can be painlessly restarted.

Can be used something like below

criu restore ... --action-script /usr/libexec/criu/scripts/systemd-autofs-restart.sh

It restarts only one service so far: proc-sys-fs-binfmt_misc.automount. But it can be easily extended to support any other.