2014-02-25 00:21:35 -05:00
|
|
|
package native
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
2014-06-30 18:27:15 -04:00
|
|
|
|
|
|
|
"github.com/docker/libcontainer"
|
2014-02-25 00:21:35 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type info struct {
|
|
|
|
ID string
|
|
|
|
driver *driver
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsRunning is determined by looking for the
|
2014-02-26 22:19:14 -05:00
|
|
|
// pid file for a container. If the file exists then the
|
2014-02-25 00:21:35 -05:00
|
|
|
// container is currently running
|
|
|
|
func (i *info) IsRunning() bool {
|
2014-06-30 18:27:15 -04:00
|
|
|
if _, err := libcontainer.GetState(filepath.Join(i.driver.root, i.ID)); err == nil {
|
2014-02-25 00:21:35 -05:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|