Run immediately starts the process inside the container. Returns an error if the process fails to start. It does not block waiting for the exec fifo after start returns but opens the fifo after start returns.
(process *Process)
| 212 | // the process fails to start. It does not block waiting for the exec fifo |
| 213 | // after start returns but opens the fifo after start returns. |
| 214 | func (c *Container) Run(process *Process) error { |
| 215 | c.m.Lock() |
| 216 | defer c.m.Unlock() |
| 217 | if err := c.start(process); err != nil { |
| 218 | return err |
| 219 | } |
| 220 | if process.Init { |
| 221 | return c.exec() |
| 222 | } |
| 223 | return nil |
| 224 | } |
| 225 | |
| 226 | // Exec signals the container to exec the users process at the end of the init. |
| 227 | func (c *Container) Exec() error { |