[19.03 backport] Ensure parent dir exists for mount cleanup file
| ... | ... |
@@ -1265,6 +1265,10 @@ func setupDaemonRootPropagation(cfg *config.Config) error {
|
| 1265 | 1265 |
return nil |
| 1266 | 1266 |
} |
| 1267 | 1267 |
|
| 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 |
+ |
|
| 1268 | 1272 |
if err := ioutil.WriteFile(cleanupFile, nil, 0600); err != nil {
|
| 1269 | 1273 |
return errors.Wrap(err, "error writing file to signal mount cleanup on shutdown") |
| 1270 | 1274 |
} |