Merge lp:~xianghui/charms/precise/hadoop/fix-dnsdomainname-unknown into lp:~charmers/charms/precise/hadoop/trunk

Proposed by Xiang Hui
Status: Merged
Merged at revision: 34
Proposed branch: lp:~xianghui/charms/precise/hadoop/fix-dnsdomainname-unknown
Merge into: lp:~charmers/charms/precise/hadoop/trunk
Diff against target: 29 lines (+7/-4)
2 files modified
hooks/hadoop-common (+6/-3)
revision (+1/-1)
To merge this branch: bzr merge lp:~xianghui/charms/precise/hadoop/fix-dnsdomainname-unknown
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
Jonathan Davies (community) Approve
Edward Hope-Morley Pending
James Page Pending
Review via email: mp+213774@code.launchpad.net

Description of the change

Fix dnsdomainname: Name or service not known error.

To post a comment you must log in.
Revision history for this message
Jonathan Davies (jpds) wrote :

+1.

review: Approve
Revision history for this message
Charles Butler (lazypower) wrote :

+1 LGTM

Thanks for the fix!

review: Approve
Revision history for this message
Xiang Hui (xianghui) wrote :

Thanks Charles !

On Tue, Jun 10, 2014 at 11:19 PM, Charles Butler <
<email address hidden>> wrote:

> Review: Approve
>
> +1 LGTM
>
> Thanks for the fix!
> --
>
> https://code.launchpad.net/~xianghui/charms/precise/hadoop/fix-dnsdomainname-unknown/+merge/213774
> You are the owner of
> lp:~xianghui/charms/precise/hadoop/fix-dnsdomainname-unknown.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hadoop-common'
2--- hooks/hadoop-common 2013-10-03 06:37:01 +0000
3+++ hooks/hadoop-common 2014-04-02 07:51:53 +0000
4@@ -11,12 +11,15 @@
5 # Fixup stuff in lxc containers
6 hostname=`hostname`
7 grep -q "^127.0.0.1.*$hostname" /etc/hosts &&
8- sed -i -e "s/^\(127.0.0.1 .*\)$hostname/\1/" /etc/hosts &&
9- echo "$private_address $hostname" >> /etc/hosts
10+ sed -i -e "s/^\(127.0.0.1 .*\)$hostname/\1/" /etc/hosts
11+
12+ #It's better to record the private_address in /etc/hosts, otherwise
13+ #dnsdomainname will return an error which makes install failed.
14+ echo "$private_address $hostname" >> /etc/hosts
15
16 # only necessary on oneiric but shouldn't break anything elsewhere
17 hostname=`hostname -f`
18- sed -i -e "s/^127.0.1.1\(.*$hostname.*\)/$private_address\1/" /etc/hosts
19+ sed -i -e "s/^127.0.0.1\(.*$hostname.*\)/$private_address\1/" /etc/hosts
20 }
21
22 # Helpers to support conditional restarts based
23
24=== modified file 'revision'
25--- revision 2012-05-03 22:05:16 +0000
26+++ revision 2014-04-02 07:51:53 +0000
27@@ -1,1 +1,1 @@
28-16
29+17

Subscribers

People subscribed via source and target branches

to all changes: