--action-script command line option, CRIU can call your action scripts (also known as hooks) at various stages of dumping/restoring. The following hooks are available:
- requested to unlock a container network (used by Docker and LXC)
- called when CRIU finished dumping tasks before unfreezing them
- called when CRIU has finished restoring tasks before unlocking the network
- called when the root task is alive and new set of namespaces is created to set them up
These hooks are added with the
--action-script shell-code-to-execute option. When called, the
CRTOOLS_SCRIPT_ACTION environment is set to a value determining which type of action is performed.
In case of RPC, action scripts are implemented as notifications. Once CRIU service wants to execute a script, it sends an RPC message to the caller and waits for it to respond with
criu_req message having
notify_success = true.
When using a library, one can set up a callback using the