Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson) Upstream-commit: 359b7df5d2af5733b8a1ea6746d062053053b23e Component: engine
22 lines
388 B
Go
22 lines
388 B
Go
package native
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
type info struct {
|
|
ID string
|
|
driver *driver
|
|
}
|
|
|
|
// IsRunning is determined by looking for the
|
|
// pid 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
|
|
}
|