2014-02-25 05:21:35 +00:00
|
|
|
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 {
|
2014-02-25 20:41:31 +00:00
|
|
|
if _, err := os.Stat(filepath.Join(i.driver.root, i.ID, "pid")); err == nil {
|
2014-02-25 05:21:35 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|