From 40f24e0ea3d75cd3c05de9d377754630bba2cac3 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Sat, 5 Aug 2017 12:12:49 +0200 Subject: [PATCH] config: use absolute ConfigPath to ensure newly written config is on the same mount - fixes #1569 --- fs/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/config.go b/fs/config.go index 291afc210..d829a0336 100644 --- a/fs/config.go +++ b/fs/config.go @@ -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)