config: use absolute ConfigPath to ensure newly written config is on the same mount - fixes #1569

This commit is contained in:
Stefan Breunig 2017-08-05 12:12:49 +02:00
parent b523cfc01d
commit 40f24e0ea3
1 changed files with 4 additions and 2 deletions

View File

@ -375,8 +375,6 @@ func LoadConfig() {
Config.TPSLimitBurst = *tpsLimitBurst
Config.BufferSize = bufferSize
ConfigPath = *configFile
Config.TrackRenames = *trackRenames
switch {
@ -414,6 +412,10 @@ func LoadConfig() {
// Load configuration file.
var err error
ConfigPath, err = filepath.Abs(*configFile)
if err != nil {
ConfigPath = *configFile
}
configData, err = loadConfigFile()
if err == errorConfigFileNotFound {
Logf(nil, "Config file %q not found - using defaults", ConfigPath)