mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 05:01:28 +00:00
More thorough test case, use container.Stop() instead of lxc-kill,
use setStopped() during the restore step
This commit is contained in:
+2
-2
@@ -136,14 +136,14 @@ func (runtime *Runtime) Register(container *Container) error {
|
||||
}
|
||||
|
||||
// FIXME: if the container is supposed to be running but is not, auto restart it?
|
||||
// If the container is supposed to be running, make sure of if
|
||||
// If the container is supposed to be running, make sure of it
|
||||
if container.State.Running {
|
||||
if output, err := exec.Command("lxc-info", "-n", container.Id).CombinedOutput(); err != nil {
|
||||
return err
|
||||
} else {
|
||||
if !strings.Contains(string(output), "RUNNING") {
|
||||
Debugf("Container %s was supposed to be running be is not.", container.Id)
|
||||
container.State.Running = false
|
||||
container.State.setStopped(-127)
|
||||
if err := container.ToDisk(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user