Example #1
0
		//fatal(err)
		//}
		rootuid := 0 // XXX
		tty, err := newTty(context, process, rootuid)
		if err != nil {
			fatal(err)
		}
		if err := tty.attach(process); err != nil {
			fatal(err)
		}
		go handleSignals(process, tty)

		err = container.Restore(process, &libcontainer.CriuOpts{
			ImagesDirectory:         imagePath,
			WorkDirectory:           context.String("work-path"),
			TcpEstablished:          context.Bool("tcp-established"),
			ExternalUnixConnections: context.Bool("ext-unix-sk"),
			ShellJob:                context.Bool("shell-job"),
		})
		if err != nil {
			tty.Close()
			if created {
				container.Destroy()
			}
			fatal(err)
		}

		status, err := process.Wait()
		if err != nil {
			exitError, ok := err.(*exec.ExitError)
			if ok {