This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new e76266e  systemvm: Fix hostname is localhost in some VRs (#3422)
e76266e is described below

commit e76266e39bc1396880caa86f5e232ef4538e3f5a
Author: ustcweizhou <[email protected]>
AuthorDate: Wed Jun 26 12:56:05 2019 +0200

    systemvm: Fix hostname is localhost in some VRs (#3422)
    
    In some virtual routers, 'hostname -f' returns 'localhost'. The hostname is 
also 'localhost' in `/var/log/messages`. This change can fix the issue in new 
VRs.
---
 systemvm/debian/opt/cloud/bin/cs/CsDhcp.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py 
b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
index e7abb90..56b4419 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
@@ -139,7 +139,8 @@ class CsDhcp(CsDataBag):
             logging.error("Caught error while trying to delete entries from 
dnsmasq.leases file: %s" % e)
 
     def preseed(self):
-        self.add_host("127.0.0.1", "localhost %s" % CsHelper.get_hostname())
+        self.add_host("127.0.0.1", "localhost")
+        self.add_host("127.0.1.1", "%s" % CsHelper.get_hostname())
         self.add_host("::1", "localhost ip6-localhost ip6-loopback")
         self.add_host("ff02::1", "ip6-allnodes")
         self.add_host("ff02::2", "ip6-allrouters")

Reply via email to