MCPcopy
hub / github.com/opencontainers/runc / hasInit

Method hasInit

libcontainer/container_linux.go:894–907  ·  view source on GitHub ↗

hasInit tells whether the container init process exists.

()

Source from the content-addressed store, hash-verified

892
893// hasInit tells whether the container init process exists.
894func (c *Container) hasInit() bool {
895 if c.initProcess == nil {
896 return false
897 }
898 pid := c.initProcess.pid()
899 stat, err := system.Stat(pid)
900 if err != nil {
901 return false
902 }
903 if stat.StartTime != c.initProcessStartTime || stat.State == system.Zombie || stat.State == system.Dead {
904 return false
905 }
906 return true
907}
908
909func (c *Container) isPaused() (bool, error) {
910 state, err := c.cgroupManager.GetFreezerState()

Callers 7

ignoreCgroupErrorMethod · 0.95
SignalMethod · 0.95
signalMethod · 0.95
refreshStateMethod · 0.95
transitionMethod · 0.80
destroyMethod · 0.80
destroyMethod · 0.80

Calls 2

StatFunction · 0.92
pidMethod · 0.65

Tested by

no test coverage detected