trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject [1/3] git commit: backport: r1137894 / 519a06b1faeab5b431c47acb0e4934df0b3b5534
Date Thu, 16 Feb 2012 21:23:50 GMT
Updated Branches:
  refs/heads/3.0.x 1e40da580 -> 9c07b0b53


backport: r1137894 / 519a06b1faeab5b431c47acb0e4934df0b3b5534

[TS-845] make proxy.config.cluster.ethernet_interface default to lo/lo0

lo on linux and lo0 on bsd derivatives. it does no effect when you
really want to setup the cluster type=1, in that case you will need
to change the interface to a real interface like eth0. this patch
will just make it is safe to remove the whole cluster config block
from records.config if you like, and don't drive the newbie crazy
when they copy the records.config to another system where there is
no eth0 but bonding0.
we may need to rework the whole ClusterComunication system initialize
when we have someone cleanup the mgmt/web2(the webui).

review/test: zym, zwoop, igalic
backport: igalic


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9c07b0b5
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9c07b0b5
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9c07b0b5

Branch: refs/heads/3.0.x
Commit: 9c07b0b53f33d65c152e9052ff2cf8950263baf8
Parents: 8223f87
Author: Zhao Yongming <zym@apache.org>
Authored: Tue Jun 21 07:44:29 2011 +0000
Committer: Igor Galić <igalic@apache.org>
Committed: Thu Feb 16 22:19:56 2012 +0100

----------------------------------------------------------------------
 CHANGES                                |    5 +++++
 STATUS                                 |    6 ------
 build/network.m4                       |   21 ++++++++-------------
 configure.ac                           |    2 +-
 lib/ts/ink_config.h.in                 |    2 ++
 mgmt/Main.cc                           |    1 +
 mgmt/RecordsConfig.cc                  |    2 +-
 proxy/config/records.config.default.in |    2 +-
 8 files changed, 19 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 907b918..8cce3f2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
                                                          -*- coding: utf-8 -*-
+Changes with Apache Traffic Server 3.0.4
+
+  *) [TS-845] make proxy.config.cluster.ethernet_interface default to
+   loopback interface: lo on linux and lo0 on bsd derivatives
+
 Changes with Apache Traffic Server 3.0.3
 
   *) [TS-876] forward map based on request receive port

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/STATUS
----------------------------------------------------------------------
diff --git a/STATUS b/STATUS
index 4f35e54..0f3a4d3 100644
--- a/STATUS
+++ b/STATUS
@@ -40,12 +40,6 @@ A list of all bugs open for the next v3.0.4 release can be found at
 
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
 
-  *) invalid setting of proxy.config.cluster.ethernet_interface will prevent traffc_manager
from starting
-   Master patch SHA: 519a06b1faeab5b431c47acb0e4934df0b3b5534
-   Trunk patch: http://svn.apache.org/viewvc?view=rev&rev=1137894
-   Jira: https://issues.apache.org/jira/browse/TS-845
-   +1: zym, zwoop, igalic
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/build/network.m4
----------------------------------------------------------------------
diff --git a/build/network.m4 b/build/network.m4
index 06e134f..70f1a35 100644
--- a/build/network.m4
+++ b/build/network.m4
@@ -95,25 +95,20 @@ AC_SUBST(gethostbyname_r_hostent_data)
 ])
 
 dnl
-dnl TS_CHECK_DEFAULT_IFACE: try to figure out default network interface
+dnl TS_CHECK_LOOPBACK_IFACE: try to figure out default loopback interface
 dnl
-AC_DEFUN([TS_CHECK_DEFAULT_IFACE], [
-default_net_iface=""
-AC_MSG_CHECKING([for default network interface])
+AC_DEFUN([TS_CHECK_LOOPBACK_IFACE], [
+default_loopback_iface=""
+AC_MSG_CHECKING([for loopback network interface])
 case $host_os in
   linux*)
-    default_net_iface=[`/sbin/ifconfig | sed 's/^ *$/CRLF/g' | tr '\n' ' ' | sed 's/CRLF
/\n/g' | grep -v LOOPBACK | grep 'UP.*RUNNING' | head -1 | awk '{ n=1; print $n; }' 2>/dev/null`]
+    default_loopback_iface=lo
   ;;
 darwin* | freebsd* | solaris*)
-  default_net_iface=[`/sbin/ifconfig -a | grep 'UP.*RUNNING' | grep -v LOOPBACK | head -1
| awk -F: '{  n=1; print $n; }'`]
+  default_loopback_iface=lo0
   ;;
 esac
-if test "x$default_net_iface" = "x"; then
-  AC_MSG_RESULT([not found. Using default eth0])
-  default_net_iface=eth0
-else
-  AC_MSG_RESULT([$default_net_iface])
-fi
-AC_SUBST([default_net_iface])
+AC_MSG_RESULT([$default_loopback_iface])
+AC_SUBST([default_loopback_iface])
 ])
 dnl

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index fa6bc0d..5bd2360 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1127,7 +1127,7 @@ AS_IF([test "x$enable_tproxy" != "xno"], [
 AC_SUBST(use_tproxy)
 AC_SUBST(ip_transparent)
 
-TS_CHECK_DEFAULT_IFACE
+TS_CHECK_LOOPBACK_IFACE
 TS_CHECK_GETHOSTBYNAME_R_STYLE
 
 #

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/lib/ts/ink_config.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index ffaa7b4..ed199cc 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -189,4 +189,6 @@
 #define TS_BUILD_CACHEDIR "@rel_cachedir@"
 #define TS_BUILD_INFODIR "@rel_infodir@"
 
+#define TS_BUILD_DEFAULT_LOOPBACK_IFACE "@default_loopback_iface@"
+
 #endif /* _ink_config_h */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 230284f..d4ab3ef 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -765,6 +765,7 @@ main(int argc, char **argv)
                group_addr, "224.0.1.0 - 239.255.255.255");
   }
 
+  /* TODO: Do we really need to init cluster communication? */
   lmgmt->initCCom(cluster_port, group_addr, cluster_server_port);       /* Setup cluster
communication */
 
   lmgmt->initMgmtProcessServer();       /* Setup p-to-p process server */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index e008006..a679ed2 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -876,7 +876,7 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.cluster.cluster_configuration", RECD_STRING, "cluster.config",
RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.cluster.ethernet_interface", RECD_STRING, NULL, RECU_RESTART_TS,
RR_REQUIRED, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.cluster.ethernet_interface", RECD_STRING, TS_BUILD_DEFAULT_LOOPBACK_IFACE,
RECU_RESTART_TS, RR_REQUIRED, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.cluster.enable_monitor", RECD_INT, "0", RECU_DYNAMIC, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
   ,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c07b0b5/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index 8f6bd05..ac7a80e 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -300,7 +300,7 @@ CONFIG proxy.config.cluster.mcport INT 8089
 CONFIG proxy.config.cluster.mc_group_addr STRING 224.0.1.37
 CONFIG proxy.config.cluster.mc_ttl INT 1
 CONFIG proxy.config.cluster.log_bogus_mc_msgs INT 1
-CONFIG proxy.config.cluster.ethernet_interface STRING @default_net_iface@
+CONFIG proxy.config.cluster.ethernet_interface STRING @default_loopback_iface@
 ##############################################################################
 #
 # Cache


Mime
View raw message