trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] 03/09: Add records configuration support to traffic_ctl.
Date Fri, 12 Jan 2018 16:03:44 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit c6a741ea535597a1e50264d9b7311bd0c25cb87c
Author: James Peach <jpeach@apache.org>
AuthorDate: Fri Jun 9 21:25:44 2017 -0700

    Add records configuration support to traffic_ctl.
    
    (cherry picked from commit ab19da39ce31d046b2d6da0299aeb30a106f7f34)
    
     Conflicts:
    	cmd/traffic_ctl/Makefile.am
---
 cmd/traffic_ctl/Makefile.am    |  7 ++++++-
 cmd/traffic_ctl/traffic_ctl.cc | 14 +++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/cmd/traffic_ctl/Makefile.am b/cmd/traffic_ctl/Makefile.am
index 4b4fb78..2d8b80b 100644
--- a/cmd/traffic_ctl/Makefile.am
+++ b/cmd/traffic_ctl/Makefile.am
@@ -21,6 +21,7 @@ AM_CPPFLAGS += \
   $(iocore_include_dirs) \
   -I$(abs_top_srcdir)/lib \
   -I$(abs_top_srcdir)/lib/records \
+  -I$(abs_top_srcdir)/mgmt \
   -I$(abs_top_srcdir)/mgmt/api/include
 
 bin_PROGRAMS = traffic_ctl
@@ -35,9 +36,13 @@ traffic_ctl_SOURCES = \
   traffic_ctl.cc
 
 traffic_ctl_LDADD = \
+  $(top_builddir)/lib/records/librecords_p.a \
+  $(top_builddir)/mgmt/libmgmt_p.la \
+  $(top_builddir)/iocore/eventsystem/libinkevent.a \
+  $(top_builddir)/proxy/shared/libUglyLogStubs.a \
   $(top_builddir)/mgmt/api/libtsmgmt.la \
   $(top_builddir)/lib/ts/libtsutil.la \
-  @LIBRESOLV@ @LIBTCL@
+  @LIBTCL@ @HWLOC_LIBS@
 
 include $(top_srcdir)/build/tidy.mk
 
diff --git a/cmd/traffic_ctl/traffic_ctl.cc b/cmd/traffic_ctl/traffic_ctl.cc
index c67c0f8..59ad001 100644
--- a/cmd/traffic_ctl/traffic_ctl.cc
+++ b/cmd/traffic_ctl/traffic_ctl.cc
@@ -23,6 +23,10 @@
 
 #include "traffic_ctl.h"
 
+#include "ts/I_Layout.h"
+#include "I_RecProcess.h"
+#include "RecordsConfig.h"
+
 AppVersionInfo CtrlVersionInfo;
 
 const char *
@@ -245,16 +249,20 @@ main(int argc, const char **argv)
     diags->show_location                      = SHOW_LOCATION_DEBUG;
   }
 
-  CtrlDebug("debug logging active");
-
   if (n_file_arguments < 1) {
     return CtrlSubcommandUsage(nullptr, commands, countof(commands), argument_descriptions,
countof(argument_descriptions));
   }
 
+  Layout::create();
+  RecProcessInit(RECM_STAND_ALONE, diags);
+  LibRecordsConfigInit();
+
+  ats_scoped_str rundir(RecConfigReadRuntimeDir());
+
   // Make a best effort to connect the control socket. If it turns out we are just displaying
help or something then it
   // doesn't matter that we failed. If we end up performing some operation then that operation
will fail and display the
   // error.
-  TSInit(nullptr, static_cast<TSInitOptionT>(TS_MGMT_OPT_NO_EVENTS | TS_MGMT_OPT_NO_SOCK_TESTS));
+  TSInit(rundir, static_cast<TSInitOptionT>(TS_MGMT_OPT_NO_EVENTS | TS_MGMT_OPT_NO_SOCK_TESTS));
 
   for (unsigned i = 0; i < countof(commands); ++i) {
     if (strcmp(file_arguments[0], commands[i].name) == 0) {

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message