diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index 0c518e35..294109cd 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -170,6 +170,13 @@ func (c *linuxContainer) Stats() (*Stats, error) { func (c *linuxContainer) Set(config configs.Config) error { c.m.Lock() defer c.m.Unlock() + status, err := c.currentStatus() + if err != nil { + return err + } + if status == Stopped { + return newGenericError(fmt.Errorf("container not running"), ContainerNotRunning) + } c.config = &config return c.cgroupManager.Set(c.config) }