mirror of
https://github.com/containers/podman.git
synced 2025-05-21 09:05:56 +08:00
Ensure directory where we will make database exists
Ensure that the directory where we will create the Podman db exists prior to creating the database - otherwise creating the DB will fail. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
@ -472,6 +472,15 @@ func makeRuntime(runtime *Runtime) (err error) {
|
||||
runtime.config.ConmonPath)
|
||||
}
|
||||
|
||||
// Make the static files directory if it does not exist
|
||||
if err := os.MkdirAll(runtime.config.StaticDir, 0700); err != nil {
|
||||
// The directory is allowed to exist
|
||||
if !os.IsExist(err) {
|
||||
return errors.Wrapf(err, "error creating runtime static files directory %s",
|
||||
runtime.config.StaticDir)
|
||||
}
|
||||
}
|
||||
|
||||
// Set up the state
|
||||
switch runtime.config.StateType {
|
||||
case InMemoryStateStore:
|
||||
@ -601,15 +610,6 @@ func makeRuntime(runtime *Runtime) (err error) {
|
||||
}
|
||||
runtime.ociRuntime = ociRuntime
|
||||
|
||||
// Make the static files directory if it does not exist
|
||||
if err := os.MkdirAll(runtime.config.StaticDir, 0755); err != nil {
|
||||
// The directory is allowed to exist
|
||||
if !os.IsExist(err) {
|
||||
return errors.Wrapf(err, "error creating runtime static files directory %s",
|
||||
runtime.config.StaticDir)
|
||||
}
|
||||
}
|
||||
|
||||
// Make a directory to hold container lockfiles
|
||||
lockDir := filepath.Join(runtime.config.TmpDir, "lock")
|
||||
if err := os.MkdirAll(lockDir, 0755); err != nil {
|
||||
|
Reference in New Issue
Block a user