<div dir="ltr">Yup, ttys are painful :( I'll dig deeper too and check back with you. Please let me know if you need instructions to reproduce the problem.<div><br></div><div>--Saied</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 10, 2015 at 12:29 PM, Cyrill Gorcunov <span dir="ltr"><<a href="mailto:gorcunov@gmail.com" target="_blank">gorcunov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Mar 10, 2015 at 12:06:58PM -0700, Saied Kazemi wrote:<br>
> Thanks for your quick reply Cyrill. You're right, the --shell-job flag<br>
> was missing in the nsinit version I was using. Dump succeeds now but<br>
> restore still fails with different errors.<br>
> $ /home/saied/work/crtools/criu --version<br>
> Version: 1.5<br>
> GitID: ad6e9b9<br>
> With --shell-job:<br>
> $ sudo nsinit -criu /home/saied/work/crtools/criu restore<br>
> >>> Restore(): []string{"restore", "-v4", "-D", "nsinit/checkpoint", "-o",<br>
> "restore.log", "--root", "/home/saied/work/busybox", "--manage-cgroups",<br>
> "--evasive-devices", "--shell-job"}<br>
> exit status 1: <br>
> $ sudo grep Error nsinit/checkpoint/restore.log<br>
> (00.000645) Error (tty.c:1584): tty: Standard stream is not a terminal,<br>
> aborting<br>
> $ <br>
> Without --shell-job:<br>
> $ sudo nsinit -criu /home/saied/work/crtools/criu restore<br>
> >>> Restore(): []string{"restore", "-v4", "-D", "nsinit/checkpoint", "-o",<br>
> "restore.log", "--root", "/home/saied/work/busybox", "--manage-cgroups",<br>
> "--evasive-devices"}<br>
> exit status 1: <br>
> $ sudo grep Error nsinit/checkpoint/restore.log<br>
> (00.051530) 1: Error (tty.c:335): tty: Found slave peer index 7<br>
> without correspond master peer<br>
> (00.051590) Error (cr-restore.c:1860): Restoring FAILED.<br>
> $ <br>
> I also get the same error even when I add --ext-mount-map<br>
> /dev/console:/dev/console on dump and --ext-mount-map<br>
> /dev/console:/dev/pts/7 on restore.<br>
> With --shell-job and --ext-mount-map:<br>
> $ sudo nsinit -criu /home/saied/work/crtools/criu restore<br>
> >>> Restore(): []string{"restore", "-v4", "-D", "nsinit/checkpoint", "-o",<br>
> "restore.log", "--root", "/home/saied/work/busybox", "--manage-cgroups",<br>
> "--evasive-devices", "--ext-mount-map", "/dev/console:/dev/pts/7"}<br>
> exit status 1: <br>
> $ sudo grep Error nsinit/checkpoint/restore.log<br>
> (00.044778) 1: Error (tty.c:335): tty: Found slave peer index 7<br>
> without correspond master peer<br>
> (00.044821) Error (cr-restore.c:1860): Restoring FAILED.<br>
> $ <br>
> Sorry if I am missing something obvious.<br>
<br>
</div></div>IIRC, we've had something similar before -- ie the CRIU on restore<br>
tries to grab stdin<br>
<br>
int tty_prep_fds(void)<br>
{<br>
if (!opts.shell_job)<br>
return 0;<br>
<br>
if (!isatty(STDIN_FILENO)) {<br>
pr_err("Standard stream is not a terminal, aborting\n");<br>
return -1;<br>
}<br>
...<br>
}<br>
<br>
which we might need to inherit terminals if --shell-job option is passed.<br>
But the restore envinronment you're running criu in has stdin pointing<br>
to something different but tty so we abort.<br>
<br>
Pavel, do you remember anything about it? I've a vague memory that<br>
we have met this problem before...<br>
<br>
As to "Found slave peer index 7 ithout correspond master peer" it's beause<br>
we don't know how to restore the master peer, it's not in image and we're<br>
not inheriting terminal. (sigh, ttys are always such a painfull thing :)<br>
<br>
If some idea pop up I'll ping you.<br>
</blockquote></div><br></div>