[CRIU] Dumping tmux session with a client connected

Allan Cecil ac at sonic.net
Tue Apr 14 18:21:17 PDT 2015


On 04/14/2015 05:44 AM, Pavel Emelyanov wrote:
> First of all, we need to somehow explain to the 16447 that the connection in question will
> probably (see below) go away and will go back when we will restore the tmux. By saying
> "probably" I mean, that if we do just "criu dump", then criu will kill 16449 and the 16447
> will see EOF on its socket. If we say "criu dump --leave-running" then after dump criu will
> not kill tasks and the connection will be kept open, but then we MAY have problems restoring
> them.
> 
> So this is the tmux part. As I told, I don't know how tmux works, so I cannot say for sure
> what can be done about it.
> 
> On the CRIU side we will have to do two things. First, explain on dump that the external
> stream socket with the given number (or some other ID) is OK and CRIU should just dump it
> and do not worry about connection loss. This can be done via CLI option, e.g. by extending
> the existing one: --ext-unix-sk $ID. I'm perfectly OK with such a patch with "use at your
> own risk" comment :)
> 
> On restore we will have to establish this connection back. I see two options for this.
> 
> The first is if we add CLI option to CRIU saying that --ext-unix-sk $ID=$PATH_TO_CONNECT
> and while restoring CRIU will call connect() for the $ID socket with the $PATH_... path.
> I'm also fine with such a patch :)

Ideally, I'd like a way to use --leave-running but have no association to the client in the dump, because on restore the client will be reattached, i.e. the tmux server will be restored with no clients connected and an external call will attach the client to the newly restored server.  The issue now is there's no way to dump while the client is connected, but perhaps there's a sane patch for this.

This weekend (or maybe before), I'll try to whip something up that sidesteps the issue by forcibly killing all client sessions prior to the initial dump, then on restore automatically reconnect to the restored session.  This *should* work, with the downside that on a dump it will flash / redraw the screen.  Even then, I think this will be a very useful tool.

Thanks again for putting so much time and thought into this - I appreciate your efforts! :)

A.C.
******


More information about the CRIU mailing list