Now, if you try to simply run and try to dump such a program, criu will fail. The reason is a program you launch from the shell shares some common resources with the shell, notably its session and terminal. Criu has a built-in check that makes sure there are no such resources.

To remove the dependency on a current terminal, let's executed our script in a new session and redirect its output to a file:

Now let's see how to dump the same program when it is just started from the shell without any additional setsid and stdio redirection.
For that we need to execute our test script or another program (e.g. "top") from a terminal without any redirection.