info.go 388 B

123456789101112131415161718192021
  1. package native
  2. import (
  3. "os"
  4. "path/filepath"
  5. )
  6. type info struct {
  7. ID string
  8. driver *driver
  9. }
  10. // IsRunning is determined by looking for the
  11. // pid file for a container. If the file exists then the
  12. // container is currently running
  13. func (i *info) IsRunning() bool {
  14. if _, err := os.Stat(filepath.Join(i.driver.root, i.ID, "pid")); err == nil {
  15. return true
  16. }
  17. return false
  18. }