Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit aa860c4

Browse files
cpuguy83thaJeztah
authored andcommitted
Ensure parent dir exists for mount cleanup file
While investigating a test failure, I found this in the logs: ``` time="2019-07-04T15:06:32.622506760Z" level=warning msg="Error while setting daemon root propagation, this is not generally critical but may cause some functionality to not work or fallback to less desirable behavior" dir=/go/src/github.com/docker/docker/bundles/test-integration/d1285b8250308/root error="error writing file to signal mount cleanup on shutdown: open /tmp/dxr/d1285b8250308/unmount-on-shutdown: no such file or directory" ``` This path is generated from the daemon's exec-root, which appears to not exist yet. This change just makes sure it exists before we try to write a file. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit 7725b88edc5b7c74c1599e0180d654e8aac47598) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: c67edc5d610a25f5a2eb0663383b1d31de63ed13 Component: engine
1 parent a5906db commit aa860c4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

components/engine/daemon/daemon_unix.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,10 @@ func setupDaemonRootPropagation(cfg *config.Config) error {
12651265
return nil
12661266
}
12671267

1268+
if err := os.MkdirAll(filepath.Dir(cleanupFile), 0700); err != nil {
1269+
return errors.Wrap(err, "error creating dir to store mount cleanup file")
1270+
}
1271+
12681272
if err := ioutil.WriteFile(cleanupFile, nil, 0600); err != nil {
12691273
return errors.Wrap(err, "error writing file to signal mount cleanup on shutdown")
12701274
}

0 commit comments

Comments
 (0)