Skip to content

Commit 667b3f0

Browse files
committed
Make the logs path of system-docker configurable
1 parent 4907fc9 commit 667b3f0

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

config/schema.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ var schema = `{
196196
"properties": {
197197
"hostname": {"type": "string"},
198198
"docker": {"type": "object"},
199-
"network": {"$ref": "#/definitions/network_config"}
199+
"network": {"$ref": "#/definitions/network_config"},
200+
"system_docker_logs": {"type": "string"}
200201
}
201202
},
202203

config/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const (
2323
InitImages = "images-init.tar"
2424
SystemImages = "images-system.tar"
2525
Debug = false
26-
SystemDockerLog = "/var/log/system-docker.log"
2726
SystemDockerBin = "/usr/bin/system-dockerd"
2827

2928
DetachLabel = "io.rancher.os.detach"
@@ -215,9 +214,10 @@ type CloudInit struct {
215214
}
216215

217216
type Defaults struct {
218-
Hostname string `yaml:"hostname,omitempty"`
219-
Docker DockerConfig `yaml:"docker,omitempty"`
220-
Network netconf.NetworkConfig `yaml:"network,omitempty"`
217+
Hostname string `yaml:"hostname,omitempty"`
218+
Docker DockerConfig `yaml:"docker,omitempty"`
219+
Network netconf.NetworkConfig `yaml:"network,omitempty"`
220+
SystemDockerLogs string `yaml:"system_docker_logs,omitempty"`
221221
}
222222

223223
func (r Repositories) ToArray() []string {

os-config.tpl.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rancher:
1616
network:
1717
dns:
1818
nameservers: [8.8.8.8, 8.8.4.4]
19+
system_docker_logs: /var/log/system-docker.log
1920
ssh:
2021
daemon: true
2122
hypervisor_service: true

pkg/init/docker/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func GetLaunchConfig(cfg *config.CloudConfig, dockerCfg *config.DockerConfig) (*
4646
launchConfig.Environment = dockerCfg.Environment
4747

4848
if !cfg.Rancher.Debug {
49-
launchConfig.LogFile = config.SystemDockerLog
49+
launchConfig.LogFile = cfg.Rancher.Defaults.SystemDockerLogs
5050
}
5151

5252
return &launchConfig, args

0 commit comments

Comments
 (0)