diff --git a/config/schema.go b/config/schema.go index 2769b6b4..3eac5320 100644 --- a/config/schema.go +++ b/config/schema.go @@ -194,7 +194,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"} } }, diff --git a/config/types.go b/config/types.go index 5142793a..e5466788 100644 --- a/config/types.go +++ b/config/types.go @@ -24,7 +24,6 @@ const ( ImagesPattern = "images*.tar" ModulesArchive = "/modules.tar" Debug = false - SystemDockerLog = "/var/log/system-docker.log" SystemDockerBin = "/usr/bin/system-dockerd" HashLabel = "io.rancher.os.hash" @@ -211,9 +210,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 { diff --git a/init/init.go b/init/init.go index 828e12c0..264ff48f 100644 --- a/init/init.go +++ b/init/init.go @@ -183,7 +183,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 diff --git a/os-config.tpl.yml b/os-config.tpl.yml index bd6fbc90..c29a47ac 100644 --- a/os-config.tpl.yml +++ b/os-config.tpl.yml @@ -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