<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ebatalov</id>
	<title>CRIU - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ebatalov"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Ebatalov"/>
	<updated>2026-05-13T11:26:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=CLI/opt/--tcp-close&amp;diff=4390</id>
		<title>CLI/opt/--tcp-close</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CLI/opt/--tcp-close&amp;diff=4390"/>
		<updated>2017-07-21T14:15:10Z</updated>

		<summary type="html">&lt;p&gt;Ebatalov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Main article: [[TCP connection]]''&lt;br /&gt;
&lt;br /&gt;
tldr; This option is only used with CRIU restore command.&lt;br /&gt;
It allows your listening (server) TCP sockets to exist after process tree c/r. It drops all the other TCP connections in the process tree.&lt;br /&gt;
All your server clients will be able reconnect to its listening sockets created during process tree restore.&lt;br /&gt;
--tcp-close option allows you to migrate your servers to environments with different ip addresses if your sockets listen on addresses such as 0.0.0.0.&lt;br /&gt;
Moreover you'll be able to restore many copies of your server on different machines in this case.&lt;br /&gt;
--tcp-close option works well with another one that allows to change ip addresses of sockets in CRIU image files. It is not implemented yet (https://github.com/xemul/criu/issues/211).&lt;br /&gt;
&lt;br /&gt;
Some details:&lt;br /&gt;
&lt;br /&gt;
All the original process tree sockets data is preserved in process tree image files.&lt;br /&gt;
--tcp-close option affects all the process tree TCP sockets that have any TCP state except CLOSED and LISTEN.&lt;br /&gt;
Those affected sockets are restored in CLOSED TCP state (TCP_CLOSE Linux macro).&lt;br /&gt;
Userspace code that uses those affected sockets will just get errors from its syscalls. Then it would assume that there was a networking/peer problem&lt;br /&gt;
and it would execute usual error handling code path.&lt;br /&gt;
&lt;br /&gt;
[[Category: CLI]]&lt;br /&gt;
[[Category:Sockets]]&lt;br /&gt;
[[Category:Editor_help_needed]]&lt;/div&gt;</summary>
		<author><name>Ebatalov</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CLI/opt/--tcp-close&amp;diff=4389</id>
		<title>CLI/opt/--tcp-close</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CLI/opt/--tcp-close&amp;diff=4389"/>
		<updated>2017-07-21T13:55:50Z</updated>

		<summary type="html">&lt;p&gt;Ebatalov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''Main article: [[TCP connection]]''&lt;br /&gt;
&lt;br /&gt;
tldr; This option is only used with CRIU restore command.&lt;br /&gt;
It allows your listening (server) TCP sockets to exist after process tree c/r. It drops all the other TCP connections in the process tree.&lt;br /&gt;
All your server clients will be able reconnect to its listening sockets created during process tree restore.&lt;br /&gt;
--tcp-close option allows you to migrate your servers to environments with different ip addresses if your sockets listen on addresses such as 0.0.0.0.&lt;br /&gt;
Moreover you'll be able to restore many copies of your server on different machines in this case.&lt;br /&gt;
--tcp-close option works well with another one that allows to change ip addresses of sockets in CRIU image files. It is not implemented yet (https://github.com/xemul/criu/issues/211).&lt;br /&gt;
&lt;br /&gt;
Some details:&lt;br /&gt;
&lt;br /&gt;
All the original process tree sockets data is preserved in process tree image files.&lt;br /&gt;
--tcp-close option affects all the process tree TCP sockets that have any TCP state except CLOSED and LISTEN.&lt;br /&gt;
Those affected sockets are restored in CLOSED TCP state (TCP_CLOSE Linux macro).&lt;br /&gt;
Userspace code that uses those affected sockets will just get errors from its syscalls. Then it would assume that there was a networking/peer problem&lt;br /&gt;
and it would execute usual error handling code path.&lt;br /&gt;
&lt;br /&gt;
[[Category: CLI]]&lt;br /&gt;
[[Category:Sockets]]&lt;/div&gt;</summary>
		<author><name>Ebatalov</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Final_states&amp;diff=3032</id>
		<title>Final states</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Final_states&amp;diff=3032"/>
		<updated>2016-08-26T18:35:39Z</updated>

		<summary type="html">&lt;p&gt;Ebatalov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The concept of process tree final states =&lt;br /&gt;
&lt;br /&gt;
Final state is the state that ps tree will have after its dump or restore.&lt;br /&gt;
&lt;br /&gt;
There are 3 possible final states in CRIU:&lt;br /&gt;
# 'Running' (ps tree is executed as usual)&lt;br /&gt;
# 'Stopped' (ps tree is stopped using SIGSTOP)&lt;br /&gt;
# 'Dead' (ps tree is destroyed using SIGKILL)&lt;br /&gt;
&lt;br /&gt;
= CLI options for changing of process tree final state =&lt;br /&gt;
You can use --leave-stopped option with CRIU dump/restore commands to set process tree final state to 'Stopped'.&lt;br /&gt;
&lt;br /&gt;
Use --leave-running option to set final state to 'Running'.&lt;br /&gt;
&lt;br /&gt;
= Process tree final state after CRIU dump command =&lt;br /&gt;
&lt;br /&gt;
By default final state of process tree after dump is 'Dead'.&lt;br /&gt;
So CRIU will kill process tree after it was dumped. But why? Suppose you leave your&lt;br /&gt;
process tree running after it was dumped. What if it deleted some files it was using&lt;br /&gt;
during its dump? What if it closed some tcp connections? After that CRIU won't be able&lt;br /&gt;
to restore process tree from the dump it has created earlier.&lt;br /&gt;
System simply won't have resources that this process tree requires at&lt;br /&gt;
the moment captured in dump.&lt;br /&gt;
&lt;br /&gt;
If your process tree doesn't destroy resources it depended on before dump then you'll be able to restore it after dump with --leave-running option.&lt;br /&gt;
But be aware that your process tree left running after dump may modify some state (for example a file) in way not compatible on application level with process tree restored from this dump later.&lt;br /&gt;
&lt;br /&gt;
What about leaving process tree stopped after dump was performed? When it is needed?&lt;br /&gt;
It may be needed for debugging of CRIU. If CRIU wasn't accurate during dump command&lt;br /&gt;
then it would leave some traces in dumped process tree. You can investigate such process tree in&lt;br /&gt;
stopped state. You'll probably find some other use cases for --leave-stopped option with CRIU dump command.&lt;br /&gt;
&lt;br /&gt;
Leaving process tree running is necessary for predump command and currently --leave-stopped and&lt;br /&gt;
--leave-running options have on effect on it.&lt;br /&gt;
&lt;br /&gt;
= Process tree final state after CRIU restore command =&lt;br /&gt;
By default final state of process tree after restore is 'Running'. That's because you usually&lt;br /&gt;
want to immediately start execution of process tree after its restore. You can use --leave-stopped&lt;br /&gt;
option to restore process tree in 'Stopped' state.&lt;br /&gt;
&lt;br /&gt;
= Moving process tree from 'Stopped' state to 'Running' =&lt;br /&gt;
After criu has dumped/restored process tree in 'Stopped' state we sometimes need to continue&lt;br /&gt;
its execution putting process tree into 'Running' state. For this purpose use this [https://github.com/xemul/criu-scripts/blob/master/pstree_cont.py script]. It has only single argument - PID of process tree root.&lt;br /&gt;
&lt;br /&gt;
[[Category: Under the hood]]&lt;/div&gt;</summary>
		<author><name>Ebatalov</name></author>
	</entry>
</feed>