Files
docker-cli/components/engine/execdriver/native/info.go
Michael Crosby cd79f65fb0 Move types around in native driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8db740a38e333158e613bc5b3a7acc2605131581
Component: engine
2014-02-24 21:21:35 -08:00

23 lines
424 B
Go

package native
import (
"os"
"path/filepath"
)
type info struct {
ID string
driver *driver
}
// IsRunning is determined by looking for the
// .nspid file for a container. If the file exists then the
// container is currently running
func (i *info) IsRunning() bool {
p := filepath.Join(i.driver.root, "containers", i.ID, "root", ".nspid")
if _, err := os.Stat(p); err == nil {
return true
}
return false
}