aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-17 00:04:36 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-17 00:46:57 +0200
commitfa1a0fa5e47260349d2da761b499223d11324b58 (patch)
treef5dc6092e40da84075746a5aa1ab8e7d6ac8bc8d /lib
parent777204d72f9d184e4416f943d8a1a38051dfb5ae (diff)
Add xds-agent user systemd service file and install
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib')
-rw-r--r--lib/xdsconfig/fileconfig.go19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go
index efe94bf..d936bbe 100644
--- a/lib/xdsconfig/fileconfig.go
+++ b/lib/xdsconfig/fileconfig.go
@@ -5,7 +5,6 @@ import (
"os"
"os/user"
"path"
- "path/filepath"
common "github.com/iotbzh/xds-common/golib"
)
@@ -28,8 +27,7 @@ type FileConfig struct {
// Order to determine which config file is used:
// 1/ from command line option: "--config myConfig.json"
// 2/ $HOME/.xds/agent/agent-config.json file
-// 3/ <current_dir>/agent-config.json file
-// 4/ <executable dir>/agent-config.json file
+// 3/ /etc/xds-agent/config.json file
func updateConfigFromFile(c *Config, confFile string) (*FileConfig, error) {
@@ -41,20 +39,7 @@ func updateConfigFromFile(c *Config, confFile string) (*FileConfig, error) {
searchIn = append(searchIn, path.Join(usr.HomeDir, ".xds", "agent", "agent-config.json"))
}
- searchIn = append(searchIn, "/etc/xds-agent/agent-config.json")
-
- exePath := os.Args[0]
- ee, _ := os.Executable()
- exeAbsPath, err := filepath.Abs(ee)
- if err == nil {
- exePath, err = filepath.EvalSymlinks(exeAbsPath)
- if err == nil {
- exePath = filepath.Dir(ee)
- } else {
- exePath = filepath.Dir(exeAbsPath)
- }
- }
- searchIn = append(searchIn, path.Join(exePath, "agent-config.json"))
+ searchIn = append(searchIn, "/etc/xds-agent/config.json")
var cFile *string
for _, p := range searchIn {