1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/execdriver/native/info.go
Michael Crosby 96e33a7646 Move container.json and pid file into a root specific driver dir
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-25 12:41:31 -08:00

21 lines
391 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 {
if _, err := os.Stat(filepath.Join(i.driver.root, i.ID, "pid")); err == nil {
return true
}
return false
}