Previously we'd only ensure the config dir, which is often but not always the same as the data dir. Fixes #10126
This commit is contained in:
@@ -349,10 +349,12 @@ func (options serveOptions) Run() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that our home directory exists.
|
// Ensure that our config and data directories exist.
|
||||||
if err := syncthing.EnsureDir(locations.GetBaseDir(locations.ConfigBaseDir), 0o700); err != nil {
|
for _, loc := range []locations.BaseDirEnum{locations.ConfigBaseDir, locations.DataBaseDir} {
|
||||||
l.Warnln("Failure on home directory:", err)
|
if err := syncthing.EnsureDir(locations.GetBaseDir(loc), 0o700); err != nil {
|
||||||
os.Exit(svcutil.ExitError.AsInt())
|
l.Warnln("Failed to ensure directory exists:", err)
|
||||||
|
os.Exit(svcutil.ExitError.AsInt())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.UpgradeTo != "" {
|
if options.UpgradeTo != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user