Line 140:
Line 140:
Here is an example of dumping and restoring an external TTY:
Here is an example of dumping and restoring an external TTY:
<pre>
<pre>
−
$ ipython
+
# setsid --ctty ipython
In [1]: import os
In [1]: import os
In [2]: st = os.stat("/proc/self/fd/0")
In [2]: st = os.stat("/proc/self/fd/0")
−
In [3]: print "tty[%x:%x]" % (st.st_rdev, st.st_dev)
+
In [3]: print("tty[%x:%x]" % (st.st_rdev, st.st_dev))
−
tty:[8800:d]
+
tty[8802:19]
−
+
−
$ps -C sleep
+
# criu dump -t `pgrep ipython` --external 'tty[8802:19]'
−
PID TTY TIME CMD
+
# criu restore --inherit-fd 'fd[1]:tty[8802:9]'
−
4109 ? 00:00:00 sleep
−
−
$ ./criu dump --external 'tty[8800:d]' -D imgs -v4 -t 4109
−
$ ./criu restore --inherit-fd 'fd[1]:tty[8800:d]' -D imgs -v4
</pre>
</pre>