File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -767,6 +767,23 @@ func (c *linuxContainer) updateState(process parentProcess) error {
767767 return json .NewEncoder (f ).Encode (state )
768768}
769769
770+ func (c * linuxContainer ) checkFreezer () (Status , error ) {
771+ path := c .cgroupManager .GetPaths ()["freezer" ]
772+ _ , err := os .Stat (path )
773+ if err != nil {
774+ return Running , err
775+ }
776+ contents , err := ioutil .ReadFile (filepath .Join (path , "freezer.state" ))
777+ if err != nil {
778+ return 0 , newSystemError (err )
779+ }
780+ freezerstate := string (contents )
781+ if strings .TrimSpace (freezerstate ) == "FROZEN" {
782+ return Paused , nil
783+ }
784+ return Running , nil
785+ }
786+
770787func (c * linuxContainer ) currentStatus () (Status , error ) {
771788 if _ , err := os .Stat (filepath .Join (c .root , "checkpoint" )); err == nil {
772789 return Checkpointed , nil
@@ -781,7 +798,13 @@ func (c *linuxContainer) currentStatus() (Status, error) {
781798 }
782799 return 0 , newSystemError (err )
783800 }
784- if c .config .Cgroups != nil && c .config .Cgroups .Freezer == configs .Frozen {
801+ status , err := c .checkFreezer ()
802+ if err != nil {
803+ if os .IsNotExist (err ) {
804+ return Running , nil
805+ }
806+ }
807+ if status == Paused {
785808 return Paused , nil
786809 }
787810 return Running , nil
You can’t perform that action at this time.
0 commit comments