Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Inheriting FDs on restore
(edit)
Revision as of 12:19, 19 July 2020
92 bytes removed
,
12:19, 19 July 2020
→External TTYs
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>
Radostin
327
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Request account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help
Tools
Special pages
Printable version
News
Twitter
YouTube
External resources
Github / source code
Issues / bugs
Mr. Jenkins
Open Hub
OpenVZ