Skip to content

Commit

Permalink
patch for issue opencontainers#39:
Browse files Browse the repository at this point in the history
     runc always shows "container in use" if /var/run/ocf/container exists
     However, there are two cases
         1) case 1: "container in use"
         2) case 2: /var/run/ocf/container still exists after runc was terminated by SIGKILL or abnormal crash
     For case 2, runc should yield "delete the lock dir" instead of "container in use"
     This patch is for this issue using "pid" file in /var/run/ocf/container/task
     minor revision opencontainers#1: error indentation, slice length check for "exeName"
     minor revision opencontainers#2: use "filepath.join" instead of "fmt.Sprintf"

Signed-off-by: Jin-Hwan Jeong <[email protected]>
  • Loading branch information
jhjeong-kr committed Jul 19, 2015
1 parent a4229ff commit 79f75bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcontainer/factory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (l *LinuxFactory) Create(id string, config *configs.Config) (Container, err
if err != nil {
return nil, newGenericError(fmt.Errorf("delete the directory: %s", containerRoot), IdInUse)
}
procPath := fmt.Sprintf("/proc/%s/cmdline", pid)
procPath := filepath.Join("/proc", string(pid), "/cmdline")
cmdline, err := ioutil.ReadFile(procPath)
if err != nil {
return nil, newGenericError(fmt.Errorf("delete the directory: %s", containerRoot), IdInUse)
Expand Down

0 comments on commit 79f75bf

Please sign in to comment.