| @@ -108,7 +108,7 @@ func start(log *os.File) error { | |||||||
| 		return nil | 		return nil | ||||||
| 	} | 	} | ||||||
| 	var exitShim bool | 	var exitShim bool | ||||||
| 	for { | 	for !exitShim { | ||||||
| 		select { | 		select { | ||||||
| 		case s := <-signals: | 		case s := <-signals: | ||||||
| 			switch s { | 			switch s { | ||||||
| @@ -122,18 +122,6 @@ func start(log *os.File) error { | |||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			// runtime has exited so the shim can also exit |  | ||||||
| 			if exitShim { |  | ||||||
| 				// kill all processes in the container incase it was not running in |  | ||||||
| 				// its own PID namespace |  | ||||||
| 				p.killAll() |  | ||||||
| 				// wait for all the processes and IO to finish |  | ||||||
| 				p.Wait() |  | ||||||
| 				// delete the container from the runtime |  | ||||||
| 				p.delete() |  | ||||||
| 				// the close of the exit fifo will happen when the shim exits |  | ||||||
| 				return nil |  | ||||||
| 			} |  | ||||||
| 		case msg := <-msgC: | 		case msg := <-msgC: | ||||||
| 			switch msg.Type { | 			switch msg.Type { | ||||||
| 			case 0: | 			case 0: | ||||||
| @@ -153,6 +141,17 @@ func start(log *os.File) error { | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	// runtime has exited so the shim can also exit | ||||||
|  |  | ||||||
|  | 	// kill all processes in the container incase it was not running in | ||||||
|  | 	// its own PID namespace | ||||||
|  | 	p.killAll() | ||||||
|  | 	// wait for all the processes and IO to finish | ||||||
|  | 	p.Wait() | ||||||
|  | 	// delete the container from the runtime | ||||||
|  | 	p.delete() | ||||||
|  | 	// the close of the exit fifo will happen when the shim exits | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ type checkpoint struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| type processState struct { | type processState struct { | ||||||
| 	Terminal    bool     `json:terminal` | 	Terminal    bool     `json:"terminal"` | ||||||
| 	Exec        bool     `json:"exec"` | 	Exec        bool     `json:"exec"` | ||||||
| 	Stdin       string   `json:"containerdStdin"` | 	Stdin       string   `json:"containerdStdin"` | ||||||
| 	Stdout      string   `json:"containerdStdout"` | 	Stdout      string   `json:"containerdStdout"` | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Crosby
					Michael Crosby