Merge pull request #4598 from creack/fix_lxc
Fix lxc Upstream-commit: f9fde52a073f7c5a8a283ee694939aabe01a81dd Component: engine
This commit is contained in:
@ -168,6 +168,9 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
|
||||
// Poll lxc for RUNNING status
|
||||
pid, err := d.waitForStart(c, waitLock)
|
||||
if err != nil {
|
||||
if c.Process != nil {
|
||||
c.Process.Kill()
|
||||
}
|
||||
return -1, err
|
||||
}
|
||||
c.ContainerPid = pid
|
||||
|
||||
@ -36,7 +36,7 @@ func parseLxcInfo(raw string) (*lxcInfo, error) {
|
||||
if len(parts) < 2 {
|
||||
continue
|
||||
}
|
||||
switch strings.TrimSpace(parts[0]) {
|
||||
switch strings.ToLower(strings.TrimSpace(parts[0])) {
|
||||
case "state":
|
||||
info.Running = strings.TrimSpace(parts[1]) == "RUNNING"
|
||||
case "pid":
|
||||
|
||||
@ -2384,7 +2384,13 @@ func (srv *Server) IsRunning() bool {
|
||||
}
|
||||
|
||||
func (srv *Server) Close() error {
|
||||
if srv == nil {
|
||||
return nil
|
||||
}
|
||||
srv.SetRunning(false)
|
||||
if srv.runtime == nil {
|
||||
return nil
|
||||
}
|
||||
return srv.runtime.Close()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user