aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/admin/vespa-wrapper/configserver/env.go
blob: 1c4c33f56288b7ce6b4eb0d6107230ae008c8c55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej

package configserver

import (
	"fmt"
	"os"

	"github.com/vespa-engine/vespa/client/go/internal/admin/envvars"
	"github.com/vespa-engine/vespa/client/go/internal/util"
)

func exportSettings(vespaHome string) {
	vlt := fmt.Sprintf("file:%s/logs/vespa/vespa.log", vespaHome)
	lcd := fmt.Sprintf("%s/var/db/vespa/logcontrol", vespaHome)
	lcf := fmt.Sprintf("%s/configserver.logcontrol", lcd)
	dlp := fmt.Sprintf("%s/lib64", vespaHome)
	app := fmt.Sprintf("%s/conf/configserver-app", vespaHome)
	os.Setenv(envvars.VESPA_LOG_TARGET, vlt)
	os.Setenv(envvars.VESPA_LOG_CONTROL_DIR, lcd)
	os.Setenv(envvars.VESPA_LOG_CONTROL_FILE, lcf)
	os.Setenv(envvars.VESPA_SERVICE_NAME, "configserver")
	os.Setenv(envvars.LD_LIBRARY_PATH, dlp)
	os.Setenv(envvars.JAVAVM_LD_PRELOAD, "")
	os.Setenv(envvars.LD_PRELOAD, "")
	os.Setenv(envvars.STANDALONE_JDISC_APP_LOCATION, app)
	os.Setenv(envvars.STANDALONE_JDISC_DEPLOYMENT_PROFILE, "configserver")
	os.Setenv(envvars.MALLOC_ARENA_MAX, "1")
	util.OptionallyReduceTimerFrequency()
}