Example #1
0
		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 {
				status = exitError.ProcessState
			} else {
				tty.Close()
				if created {
					container.Destroy()
				}
				fatal(err)