1
0
mirror of https://github.com/rancher/os.git synced 2025-08-14 21:15:15 +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": { "properties": {
"hostname": {"type": "string"}, "hostname": {"type": "string"},
"docker": {"type": "object"}, "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" InitImages = "images-init.tar"
SystemImages = "images-system.tar" SystemImages = "images-system.tar"
Debug = false Debug = false
SystemDockerLog = "/var/log/system-docker.log"
SystemDockerBin = "/usr/bin/system-dockerd" SystemDockerBin = "/usr/bin/system-dockerd"
DetachLabel = "io.rancher.os.detach" DetachLabel = "io.rancher.os.detach"
@ -215,9 +214,10 @@ type CloudInit struct {
} }
type Defaults struct { type Defaults struct {
Hostname string `yaml:"hostname,omitempty"` Hostname string `yaml:"hostname,omitempty"`
Docker DockerConfig `yaml:"docker,omitempty"` Docker DockerConfig `yaml:"docker,omitempty"`
Network netconf.NetworkConfig `yaml:"network,omitempty"` Network netconf.NetworkConfig `yaml:"network,omitempty"`
SystemDockerLogs string `yaml:"system_docker_logs,omitempty"`
} }
func (r Repositories) ToArray() []string { func (r Repositories) ToArray() []string {

View File

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

View File

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