summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-11 11:05:55 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-11 15:46:53 +0100
commit57bdfc8349b3c8a727d6f439e1fd12661bc00a15 (patch)
tree9682a32b7feb2f6ac7429f01bcca6ac77327a8d3
parent7adfd21a66846ebb907bdcfd411e00670d70fa06 (diff)
Standardized XDS config file name and location.
- config file name is : agent-config.json - xds-agent settings under user's home is: $HOME/.xds/agent - xds-agent settings under etc is: /etc/xds/agent Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--Makefile2
-rw-r--r--conf.d/etc/xds/agent/agent-config.json (renamed from conf.d/etc/xds-agent/agent-config.json)0
-rw-r--r--conf.d/usr/lib/systemd/user/xds-agent.service2
-rw-r--r--lib/agent/agent.go2
-rw-r--r--lib/syncthing/st.go2
-rw-r--r--lib/xdsconfig/configfile.go4
-rwxr-xr-xscripts/install.sh2
7 files changed, 7 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 1d5c909..898b552 100644
--- a/Makefile
+++ b/Makefile
@@ -158,7 +158,7 @@ package: clean tools/syncthing vendor build
ifneq ($(GOOS), windows)
@cp -r $(ROOT_SRCDIR)/conf.d $(ROOT_SRCDIR)/scripts $(PACKAGE_DIR)/$(TARGET)/
endif
- @cp $(ROOT_SRCDIR)/conf.d/etc/xds-agent/agent-config.json $(PACKAGE_DIR)/$(TARGET)/agent-config.json.in
+ @cp $(ROOT_SRCDIR)/conf.d/etc/xds/agent/agent-config.json $(PACKAGE_DIR)/$(TARGET)/agent-config.json.in
@cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./$(TARGET)
@echo "### Package $(PACKAGE_ZIPFILE) has been successfuly built - $(BUILD_MODE)"
diff --git a/conf.d/etc/xds-agent/agent-config.json b/conf.d/etc/xds/agent/agent-config.json
index 1a7957e..1a7957e 100644
--- a/conf.d/etc/xds-agent/agent-config.json
+++ b/conf.d/etc/xds/agent/agent-config.json
diff --git a/conf.d/usr/lib/systemd/user/xds-agent.service b/conf.d/usr/lib/systemd/user/xds-agent.service
index 1fd038b..6db084d 100644
--- a/conf.d/usr/lib/systemd/user/xds-agent.service
+++ b/conf.d/usr/lib/systemd/user/xds-agent.service
@@ -3,7 +3,7 @@ Description=XDS Agent
[Service]
EnvironmentFile=-/etc/default/xds-agent
-ExecStart=/opt/AGL/xds/agent/xds-agent &
+ExecStart=/opt/AGL/xds/agent/xds-agent
[Install]
WantedBy=multi-user.target
diff --git a/lib/agent/agent.go b/lib/agent/agent.go
index 58a2ba0..a562e77 100644
--- a/lib/agent/agent.go
+++ b/lib/agent/agent.go
@@ -132,7 +132,7 @@ func (ctx *Context) Run() (int, error) {
ctx._logPrint("Logging file for HTTP requests: %s\n", logFileHTTPReq)
}
- // Create syncthing instance when section "syncthing" is present in config.json
+ // Create syncthing instance when section "syncthing" is present in agent-config.json
if ctx.Config.FileConf.SThgConf != nil {
ctx.SThg = st.NewSyncThing(ctx.Config, ctx.Log)
}
diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go
index ac1e99d..c4b72c5 100644
--- a/lib/syncthing/st.go
+++ b/lib/syncthing/st.go
@@ -278,7 +278,7 @@ func (s *SyncThing) Start() (*exec.Cmd, error) {
*/
s.STCmd, err = s.startProc("syncthing", args, env, &s.exitSTChan)
- // Use autogenerated apikey if not set by config.json
+ // Use autogenerated apikey if not set by agent-config.json
if err == nil && s.APIKey == "" {
if fd, err := os.Open(filepath.Join(s.Home, "config.xml")); err == nil {
defer fd.Close()
diff --git a/lib/xdsconfig/configfile.go b/lib/xdsconfig/configfile.go
index 71870d0..c252073 100644
--- a/lib/xdsconfig/configfile.go
+++ b/lib/xdsconfig/configfile.go
@@ -55,7 +55,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/ /etc/xds-agent/config.json file
+// 3/ /etc/xds/agent/agent-config.json file
func readGlobalConfig(c *Config, confFile string) error {
@@ -67,7 +67,7 @@ func readGlobalConfig(c *Config, confFile string) error {
searchIn = append(searchIn, path.Join(homeDir, ".xds", "agent", "agent-config.json"))
}
- searchIn = append(searchIn, "/etc/xds-agent/agent-config.json")
+ searchIn = append(searchIn, "/etc/xds/agent/agent-config.json")
var cFile *string
for _, p := range searchIn {
diff --git a/scripts/install.sh b/scripts/install.sh
index 10fc59f..444dc1b 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -28,7 +28,7 @@ install() {
mkdir -p "${DESTDIR}" && cp "${ROOT_SRCDIR}/bin/*" "${DESTDIR}" || exit 1
mkdir -p "${DESTDIR_WWW}" && cp -a "${ROOT_SRCDIR}/webapp/dist/*" "${DESTDIR_WWW}" || exit 1
- cp "${ROOT_SRCDIR}/conf.d/etc/xds-agent" /etc/ || exit 1
+ cp -a "${ROOT_SRCDIR}/conf.d/etc/xds" /etc/ || exit 1
cp "${ROOT_SRCDIR}/conf.d/etc/default/xds-agent" /etc/default/ || exit 1
FILE=/etc/profile.d/xds-agent.sh