Line 11: |
Line 11: |
| CRIU supports both direct (offset) and indirect AutoFS mount points migration. | | CRIU supports both direct (offset) and indirect AutoFS mount points migration. |
| | | |
− | Howewer, there is a limitation in migrating of systemd services, using AutoFS.
| + | However, 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. | + | 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, it ignores the request. |
| | | |
| CRIU reconstructs AutoFS mount point on restore with different device ID, thus systemd doesn't recognize it anymore. | | 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. | + | In user world it means that any access to AutoFS mount point served by systemd will stuck. Restart of the service solves this issue. |
| | | |
| == Tricks == | | == Tricks == |
| | | |
− | To overcome the limitation above, <code>systemd-autofs-restart.sh</code> action script was introduced. It can be found in <code>scripts</code> directory in CRIU sources. | + | To overcome the above limitation, <code>systemd-autofs-restart.sh</code> action script was introduced. It can be found in <code>scripts</code> directory in CRIU sources. |
| | | |
| This script is aimed to be used with CRIU option <code>--action-script</code> on restore to fix the issue for those systemd services, which can be painlessly restarted. | | This script is aimed to be used with CRIU option <code>--action-script</code> on restore to fix the issue for those systemd services, which can be painlessly restarted. |
| | | |
− | Can be used something like below
| + | It can be used like this: |
| | | |
| criu restore ... --action-script /usr/libexec/criu/scripts/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.
| + | Currently, it only restarts one service, <code>proc-sys-fs-binfmt_misc.automount</code>. Surely, it can be easily extended to support any other. |
| | | |
| [[Category:HOWTO]] | | [[Category:HOWTO]] |