[CRIU] Re: [PATCH 3/4] tty: Add checkpoint/restore for unix terminals

Cyrill Gorcunov gorcunov at openvz.org
Mon Aug 13 13:42:00 EDT 2012


On Mon, Aug 13, 2012 at 09:10:55PM +0400, Andrey Wagin wrote:
> > The main problem I've faced now is the case where
> > SID for master is set by say task 1 then this master
> > dup'ed in task 2 and then task 1 closes original
> > master thus task 2 need somehow to restore SID but
> > the kernel doesn't allow us to do that from task 2
> > since task 2 is not a session leader.
> >
> > Moreover we could restore SID from task 1 but in this
> > scenario task 2 doesn't even have file desciptor for
> > master pty.
> 
> * a controll terminal can be gotten by ioctl(fd, TIOCSCTTY, ...);
> * it can be send across an Unix socket.

Sure, note that to call for TIOCSCTTY without errors the caller
must fit the following requirements -- it must be session leader
and have no controlling tty already.

> I see only one special case, when a session leader should get this
> descriptor across unix socket for restoring a control terminal.
> But it may be solved by two ways: a session leader always creates a
> controll terminal or a free descriptor is used for unix socket. I
> prefere the first way.

Yeah, I think indeed this should be preferred way, need to think how
to implement this. Thanks!

	Cyrill


More information about the CRIU mailing list