Merge lp:~thumper/juju-core/fix-duplicate-agent-log-lines into lp:~go-bot/juju-core/trunk

Proposed by Tim Penhey
Status: Merged
Approved by: Ian Booth
Approved revision: no longer in the source branch.
Merged at revision: 1809
Proposed branch: lp:~thumper/juju-core/fix-duplicate-agent-log-lines
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 51 lines (+4/-5)
2 files modified
environs/cloudinit/cloudinit_test.go (+4/-4)
upstart/service.go (+0/-1)
To merge this branch: bzr merge lp:~thumper/juju-core/fix-duplicate-agent-log-lines
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+185420@code.launchpad.net

Commit message

Don't specify the log-file for the machine agent.

Logging now supports multiple locations. We were writing
to both stderr and the logfile, and getting duplicate lines.

Surprisingly, the unit agent didn't specify this.

https://codereview.appspot.com/13694043/

Description of the change

Don't specify the log-file for the machine agent.

Logging now supports multiple locations. We were writing
to both stderr and the logfile, and getting duplicate lines.

Surprisingly, the unit agent didn't specify this.

https://codereview.appspot.com/13694043/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reviewers: mp+185420_code.launchpad.net,

Message:
Please take a look.

Description:
Don't specify the log-file for the machine agent.

Logging now supports multiple locations. We were writing
to both stderr and the logfile, and getting duplicate lines.

Surprisingly, the unit agent didn't specify this.

https://code.launchpad.net/~thumper/juju-core/fix-duplicate-agent-log-lines/+merge/185420

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/13694043/

Affected files (+2, -1 lines):
   A [revision details]
   M upstart/service.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20130913044751-ah3cblx7arm3h2tm
+New revision: <email address hidden>

Index: upstart/service.go
=== modified file 'upstart/service.go'
--- upstart/service.go 2013-07-30 22:21:47 +0000
+++ upstart/service.go 2013-09-13 05:20:56 +0000
@@ -53,7 +53,6 @@
    },
    Cmd: filepath.Join(toolsDir, "jujud") +
     " machine" +
- " --log-file " + utils.ShQuote(logFile) +
     " --data-dir " + utils.ShQuote(dataDir) +
     " --machine-id " + machineId +
     " " + logConfig,

Revision history for this message
Ian Booth (wallyworld) wrote :
Revision history for this message
Tim Penhey (thumper) wrote :

If the bot kicks this out, it may be because it was doing r1809. The cloudinit tests are fixed in r1810.

Revision history for this message
Go Bot (go-bot) wrote :
Download full text (19.9 KiB)

The attempt to merge lp:~thumper/juju-core/fix-duplicate-agent-log-lines into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core/agent 0.736s
ok launchpad.net/juju-core/agent/tools 0.251s
ok launchpad.net/juju-core/bzr 6.735s
ok launchpad.net/juju-core/cert 2.047s
ok launchpad.net/juju-core/charm 0.609s
? launchpad.net/juju-core/charm/hooks [no test files]
ok launchpad.net/juju-core/cloudinit 0.020s
ok launchpad.net/juju-core/cmd 0.288s
? launchpad.net/juju-core/cmd/builddb [no test files]
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/juju 138.457s
ok launchpad.net/juju-core/cmd/jujud 39.620s
ok launchpad.net/juju-core/cmd/plugins/juju-metadata 2.039s
ok launchpad.net/juju-core/constraints 0.027s
ok launchpad.net/juju-core/container/lxc 0.295s
? launchpad.net/juju-core/container/lxc/mock [no test files]
ok launchpad.net/juju-core/downloader 5.286s
ok launchpad.net/juju-core/environs 1.691s
ok launchpad.net/juju-core/environs/bootstrap 4.990s

----------------------------------------------------------------------
FAIL: cloudinit_test.go:305: cloudinitSuite.TestCloudInit

test 0
script: set -xe
script: mkdir -p /var/lib/juju
script: mkdir -p /var/log/juju
script: bin='/var/lib/juju/tools/1\.2\.3-precise-amd64'
script: mkdir -p \$bin
script: wget --no-verbose -O - 'http://foo\.com/tools/juju1\.2\.3-precise-amd64\.tgz' \| tar xz -C \$bin
script: echo -n 'http://foo\.com/tools/juju1\.2\.3-precise-amd64\.tgz' > \$bin/downloaded-url\.txt
script: install -m 600 /dev/null '/etc/rsyslog\.d/25-juju\.conf'
script: printf '%s\\n' '\\n\$ModLoad imfile\\n\\n\$InputFileStateFile /var/spool/rsyslog/juju-machine-0-state\\n\$InputFilePersistStateInterval 50\\n\$InputFilePollInterval 5\\n\$InputFileName /var/log/juju/machine-0\.log\\n\$InputFileTag local-juju-machine-0:\\n\$InputFileStateFile machine-0\\n\$InputRunFileMonitor\\n\\n\$ModLoad imudp\\n\$UDPServerRun 514\\n\\n# Messages received from remote rsyslog machines contain a leading space so we\\n# need to account for that\.\\n\$template JujuLogFormatLocal,"%HOSTNAME%:%msg:::drop-last-lf%\\n"\\n\$template JujuLogFormat,"%HOSTNAME%:%msg:2:2048:drop-last-lf%\\n"\\n\\n:syslogtag, startswith, "juju-" /var/log/juju/all-machines\.log;JujuLogFormat\\n& ~\\n:syslogtag, startswith, "local-juju-" /var/log/juju/all-machines\.log;JujuLogFormatLocal\\n& ~\\n' > '/etc/rsyslog\.d/25-juju\.conf'
script: install -m 600 /dev/null '/etc/logrotate\.d/juju'
script: printf '%s\\n' '/var/log/juju/\*\.log \{\\n daily\\n minsize 5M\\n maxsize 50M\\n copytruncate\\n rotate 7\\n missingok\\n compress\\n delaycompress\\n\}' > '/etc/logrotate\.d/juju'
script: restart rsyslog
script: mkdir -p '/var/lib/juju/agents/machine-0'
script: install -m 644 /dev/null '/var/lib/juju/agents/machine-0/format'
script: printf '%s\\n' 'format 1\.16' > '/var/lib/juju/agents/machine-0/format'
script: install -m 600 /dev/null '/var/lib/juju/agents/machine-0/agent\.conf'
script: printf '%s\\n' 'tag: machine-0\\nnonce: FAKE_N...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'environs/cloudinit/cloudinit_test.go'
2--- environs/cloudinit/cloudinit_test.go 2013-09-12 21:32:12 +0000
3+++ environs/cloudinit/cloudinit_test.go 2013-09-13 05:49:58 +0000
4@@ -112,7 +112,7 @@
5 /var/lib/juju/tools/1\.2\.3-precise-amd64/jujud bootstrap-state --data-dir '/var/lib/juju' --env-config '[^']*' --constraints 'mem=2048M' --debug
6 rm -rf '/var/lib/juju/agents/bootstrap'
7 ln -s 1\.2\.3-precise-amd64 '/var/lib/juju/tools/machine-0'
8-cat >> /etc/init/jujud-machine-0\.conf << 'EOF'\\ndescription "juju machine-0 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-0/jujud machine --log-file '/var/log/juju/machine-0\.log' --data-dir '/var/lib/juju' --machine-id 0 --debug >> /var/log/juju/machine-0\.log 2>&1\\nEOF\\n
9+cat >> /etc/init/jujud-machine-0\.conf << 'EOF'\\ndescription "juju machine-0 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-0/jujud machine --data-dir '/var/lib/juju' --machine-id 0 --debug >> /var/log/juju/machine-0\.log 2>&1\\nEOF\\n
10 start jujud-machine-0
11 `,
12 }, {
13@@ -178,7 +178,7 @@
14 /var/lib/juju/tools/1\.2\.3-raring-amd64/jujud bootstrap-state --data-dir '/var/lib/juju' --env-config '[^']*' --constraints 'mem=2048M' --debug
15 rm -rf '/var/lib/juju/agents/bootstrap'
16 ln -s 1\.2\.3-raring-amd64 '/var/lib/juju/tools/machine-0'
17-cat >> /etc/init/jujud-machine-0\.conf << 'EOF'\\ndescription "juju machine-0 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-0/jujud machine --log-file '/var/log/juju/machine-0\.log' --data-dir '/var/lib/juju' --machine-id 0 --debug >> /var/log/juju/machine-0\.log 2>&1\\nEOF\\n
18+cat >> /etc/init/jujud-machine-0\.conf << 'EOF'\\ndescription "juju machine-0 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-0/jujud machine --data-dir '/var/lib/juju' --machine-id 0 --debug >> /var/log/juju/machine-0\.log 2>&1\\nEOF\\n
19 start jujud-machine-0
20 `,
21 }, {
22@@ -222,7 +222,7 @@
23 install -m 600 /dev/null '/var/lib/juju/agents/machine-99/agent\.conf'
24 printf '%s\\n' '.*' > '/var/lib/juju/agents/machine-99/agent\.conf'
25 ln -s 1\.2\.3-linux-amd64 '/var/lib/juju/tools/machine-99'
26-cat >> /etc/init/jujud-machine-99\.conf << 'EOF'\\ndescription "juju machine-99 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-99/jujud machine --log-file '/var/log/juju/machine-99\.log' --data-dir '/var/lib/juju' --machine-id 99 --debug >> /var/log/juju/machine-99\.log 2>&1\\nEOF\\n
27+cat >> /etc/init/jujud-machine-99\.conf << 'EOF'\\ndescription "juju machine-99 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-99/jujud machine --data-dir '/var/lib/juju' --machine-id 99 --debug >> /var/log/juju/machine-99\.log 2>&1\\nEOF\\n
28 start jujud-machine-99
29 `,
30 }, {
31@@ -267,7 +267,7 @@
32 install -m 600 /dev/null '/var/lib/juju/agents/machine-2-lxc-1/agent\.conf'
33 printf '%s\\n' '.*' > '/var/lib/juju/agents/machine-2-lxc-1/agent\.conf'
34 ln -s 1\.2\.3-linux-amd64 '/var/lib/juju/tools/machine-2-lxc-1'
35-cat >> /etc/init/jujud-machine-2-lxc-1\.conf << 'EOF'\\ndescription "juju machine-2-lxc-1 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-2-lxc-1/jujud machine --log-file '/var/log/juju/machine-2-lxc-1\.log' --data-dir '/var/lib/juju' --machine-id 2/lxc/1 --debug >> /var/log/juju/machine-2-lxc-1\.log 2>&1\\nEOF\\n
36+cat >> /etc/init/jujud-machine-2-lxc-1\.conf << 'EOF'\\ndescription "juju machine-2-lxc-1 agent"\\nauthor "Juju Team <juju@lists\.ubuntu\.com>"\\nstart on runlevel \[2345\]\\nstop on runlevel \[!2345\]\\nrespawn\\nnormal exit 0\\n\\nlimit nofile 20000 20000\\n\\nexec /var/lib/juju/tools/machine-2-lxc-1/jujud machine --data-dir '/var/lib/juju' --machine-id 2/lxc/1 --debug >> /var/log/juju/machine-2-lxc-1\.log 2>&1\\nEOF\\n
37 start jujud-machine-2-lxc-1
38 `,
39 },
40
41=== modified file 'upstart/service.go'
42--- upstart/service.go 2013-07-30 22:21:47 +0000
43+++ upstart/service.go 2013-09-13 05:49:58 +0000
44@@ -53,7 +53,6 @@
45 },
46 Cmd: filepath.Join(toolsDir, "jujud") +
47 " machine" +
48- " --log-file " + utils.ShQuote(logFile) +
49 " --data-dir " + utils.ShQuote(dataDir) +
50 " --machine-id " + machineId +
51 " " + logConfig,

Subscribers

People subscribed via source and target branches

to status/vote changes: