Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit ed743f7

Browse files
authored
Merge pull request #1618 from zhsj/bpo-containerd-4863
[release/1.4] Ensure log dir is created
2 parents 779131a + 8b859cb commit ed743f7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/server/helpers_unix.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ func (c *criService) seccompEnabled() bool {
151151

152152
// openLogFile opens/creates a container log file.
153153
func openLogFile(path string) (*os.File, error) {
154+
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
155+
return nil, err
156+
}
154157
return os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0640)
155158
}
156159

0 commit comments

Comments
 (0)