1
0
mirror of https://github.com/rancher/os.git synced 2025-08-02 07:24:28 +00:00

Make the logs path of system-docker configurable

This commit is contained in:
niusmallnan 2018-10-10 16:37:17 +08:00 committed by niusmallnan
parent 4907fc9a4d
commit 667b3f0b3c
4 changed files with 8 additions and 6 deletions

View File

@ -196,7 +196,8 @@ var schema = `{
"properties": {
"hostname": {"type": "string"},
"docker": {"type": "object"},
"network": {"$ref": "#/definitions/network_config"}
"network": {"$ref": "#/definitions/network_config"},
"system_docker_logs": {"type": "string"}
}
},

View File

@ -23,7 +23,6 @@ const (
InitImages = "images-init.tar"
SystemImages = "images-system.tar"
Debug = false
SystemDockerLog = "/var/log/system-docker.log"
SystemDockerBin = "/usr/bin/system-dockerd"
DetachLabel = "io.rancher.os.detach"
@ -215,9 +214,10 @@ type CloudInit struct {
}
type Defaults struct {
Hostname string `yaml:"hostname,omitempty"`
Docker DockerConfig `yaml:"docker,omitempty"`
Network netconf.NetworkConfig `yaml:"network,omitempty"`
Hostname string `yaml:"hostname,omitempty"`
Docker DockerConfig `yaml:"docker,omitempty"`
Network netconf.NetworkConfig `yaml:"network,omitempty"`
SystemDockerLogs string `yaml:"system_docker_logs,omitempty"`
}
func (r Repositories) ToArray() []string {

View File

@ -16,6 +16,7 @@ rancher:
network:
dns:
nameservers: [8.8.8.8, 8.8.4.4]
system_docker_logs: /var/log/system-docker.log
ssh:
daemon: true
hypervisor_service: true

View File

@ -46,7 +46,7 @@ func GetLaunchConfig(cfg *config.CloudConfig, dockerCfg *config.DockerConfig) (*
launchConfig.Environment = dockerCfg.Environment
if !cfg.Rancher.Debug {
launchConfig.LogFile = config.SystemDockerLog
launchConfig.LogFile = cfg.Rancher.Defaults.SystemDockerLogs
}
return &launchConfig, args