diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 32009d44f4ce2577dc4680537696bcfc3fea69c0..fa4f197846743370eef14722e295e1c4a862ec16 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -1287,6 +1287,10 @@ func setupDaemonRootPropagation(cfg *config.Config) error { return nil } + if err := os.MkdirAll(filepath.Dir(cleanupFile), 0700); err != nil { + return errors.Wrap(err, "error creating dir to store mount cleanup file") + } + if err := ioutil.WriteFile(cleanupFile, nil, 0600); err != nil { return errors.Wrap(err, "error writing file to signal mount cleanup on shutdown") }