You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ge...@apache.org on 2010/05/06 01:15:32 UTC
svn commit: r941529 - in /trafficserver/traffic/trunk: ./ example/
example/app-template/ proxy/
Author: georgep
Date: Wed May 5 23:15:31 2010
New Revision: 941529
URL: http://svn.apache.org/viewvc?rev=941529&view=rev
Log:
TS-332,TS-292: This patch adds an example application template for building with the standalone iocore and the publick I_xxx.h interfaces. This is built only when configured with '--enable-standalone-iocore'. This WIP example only serves as reference and template and not a real working application.
Tested: ubuntu904,FreeBSD(7.2),OpenSolaris(osol0906),OSX(10.5)
Added:
trafficserver/traffic/trunk/example/app-template/
trafficserver/traffic/trunk/example/app-template/Makefile.am
trafficserver/traffic/trunk/example/app-template/app-template.cc
trafficserver/traffic/trunk/example/app-template/app-template.h
trafficserver/traffic/trunk/example/app-template/records.config.in
Modified:
trafficserver/traffic/trunk/configure.ac
trafficserver/traffic/trunk/example/Makefile.am
trafficserver/traffic/trunk/proxy/Initialize.cc
trafficserver/traffic/trunk/proxy/Initialize.h
trafficserver/traffic/trunk/proxy/Makefile.am
Modified: trafficserver/traffic/trunk/configure.ac
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/configure.ac?rev=941529&r1=941528&r2=941529&view=diff
==============================================================================
--- trafficserver/traffic/trunk/configure.ac (original)
+++ trafficserver/traffic/trunk/configure.ac Wed May 5 23:15:31 2010
@@ -997,6 +997,9 @@ AC_CONFIG_FILES([example/server-transfor
AC_CONFIG_FILES([example/session-1/Makefile])
AC_CONFIG_FILES([example/thread-1/Makefile])
AC_CONFIG_FILES([example/thread-pool/Makefile])
+# example app w/ standalone iocore
+AC_CONFIG_FILES([example/app-template/Makefile])
+AC_CONFIG_FILES([example/app-template/records.config])
# -----------------------------------------------------------------------------
# 7. autoheader TEMPLATES
Modified: trafficserver/traffic/trunk/example/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/Makefile.am?rev=941529&r1=941528&r2=941529&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/Makefile.am (original)
+++ trafficserver/traffic/trunk/example/Makefile.am Wed May 5 23:15:31 2010
@@ -19,4 +19,8 @@ API_INC=$(top_srcdir)/proxy/api/include
all-am:
ln -sfn . $(top_srcdir)/proxy/api/include/ts
+if STANDALONE_IOCORE
+SUBDIRS = app-template
+else
SUBDIRS = . add-header append-transform basic-auth blacklist-0 blacklist-1 bnull-transform cache_plugin cache_scan file-1 file_system_cache gzip-transform hello null-transform output-header protocol query_remap redirect-1 remap replace-header response-header-1 server-transform session-1 thread-1 thread-pool
+endif
\ No newline at end of file
Added: trafficserver/traffic/trunk/example/app-template/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/app-template/Makefile.am?rev=941529&view=auto
==============================================================================
--- trafficserver/traffic/trunk/example/app-template/Makefile.am (added)
+++ trafficserver/traffic/trunk/example/app-template/Makefile.am Wed May 5 23:15:31 2010
@@ -0,0 +1,67 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+AM_CPPFLAGS = -I$(top_srcdir)/libinktomi++ \
+ -I$(iocore_include_dirs) \
+ -I$(top_srcdir)/librecords \
+ -I$(top_srcdir)/proxy \
+ -DPREFIX=\"$(prefix)\"
+# -I$(top_srcdir)/proxy/hdrs
+# -I$(top_srcdir)/proxy/logging
+
+
+DEFS += @IOCORE_MODULARIZED_DEFS@
+
+bin_PROGRAMS = tsapp
+
+tsapp_SOURCES = app-template.cc
+
+tsapp_LDFLAGS = @EXTRA_CXX_LDFLAGS@
+tsapp_LDADD = \
+ $(top_builddir)/proxy/libTrafficServerStandalone.a \
+ $(top_builddir)/proxy/hdrs/libhdrs.a \
+ $(top_builddir)/iocore/cache/libinkcache.a \
+ $(top_builddir)/iocore/aio/libinkaio.a \
+ $(top_builddir)/iocore/hostdb/libinkhostdb.a \
+ $(top_builddir)/iocore/dns/libinkdns.a \
+ $(top_builddir)/iocore/net/libinknet.a \
+ $(top_builddir)/iocore/utils/libinkutils.a \
+ $(top_builddir)/iocore/eventsystem/libinkevent.a \
+ $(top_builddir)/librecords/librecprocess.a \
+ $(top_builddir)/libinktomi++/libinktomi++.a \
+ @LIBTHREAD@ @LIBSOCKET@ @LIBNSL@ @LIBRESOLV@ @LIBRT@ \
+ @LIBPCRE@ @LIBDB@ @LIBSQLITE3@ @LIBSSL@ @LIBTCL@ @LIBDL@ \
+ @LIBEXPAT@ @LIBDEMANGLE@ @LIBICONV@ \
+ @LIBMLD@ @LIBEXC@ @LIBM@ @LIBEV@ @LIBPROFILER@ @LIBEXECINFO@
+
+EXTRA_DIST = records.config.in
+sysconfdir = $(pkgsysconfdir)
+nodist_sysconf_DATA = records.config
+
+install-data-local:
+ $(INSTALL) -d -o $(pkgsysuser) -g $(pkgsysgroup) $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(pkglogdir) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgdatadir)
+
+install-data-hook:
+ chown -R $(pkgsysuser):$(pkgsysgroup) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgdatadir)
+
+install-exec-local:
+ $(INSTALL) -d -o $(pkgsysuser) -g $(pkgsysgroup) $(DESTDIR)$(pkglibexecdir)
+
+install-exec-hook:
+ chown -R $(pkgsysuser):$(pkgsysgroup) $(DESTDIR)$(pkglibexecdir)
+
+uninstall-hook:
+ -rm -rf $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(pkglogdir) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkglibexecdir)
\ No newline at end of file
Added: trafficserver/traffic/trunk/example/app-template/app-template.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/app-template/app-template.cc?rev=941529&view=auto
==============================================================================
--- trafficserver/traffic/trunk/example/app-template/app-template.cc (added)
+++ trafficserver/traffic/trunk/example/app-template/app-template.cc Wed May 5 23:15:31 2010
@@ -0,0 +1,317 @@
+/** @file
+
+ A brief file description
+
+ @section license License
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+/*
+ * Example application template to be used with the standalone iocore
+ *
+ */
+
+#include "inktomi++.h"
+
+#include "I_Version.h"
+#include "I_EventSystem.h"
+#include "I_Net.h"
+#include "I_HostDB.h"
+#include "I_DNS.h"
+#include "I_SplitDNS.h"
+#include "I_Cache.h"
+
+//#include "ts.h" // plugin API's
+
+#include "Initialize.h" // TODO: move to I_Initialize.h ???
+#include "signals.h" // TODO: move to I_Signals.h ???
+
+#include "app-template.h"
+
+#define PROGRAM_NAME "tsapp"
+
+extern int use_accept_thread; // TODO: rename and move to I_UnixNetProcessor.h
+extern void RecDumpRecordsHt(RecT rec_type); // TODO: move from P_RecCore.h -> I_RecCore.h
+
+int system_num_of_processors = ink_number_of_processors();
+int system_num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
+int system_num_of_udp_threads = DEFAULT_NUMBER_OF_UDP_THREADS;
+
+char system_root_dir[PATH_NAME_MAX + 1] = DEFAULT_ROOT_DIRECTORY;
+char system_local_state_dir[PATH_NAME_MAX + 1] = DEFAULT_LOCAL_STATE_DIRECTORY;
+char system_config_directory[PATH_NAME_MAX + 1] = DEFAULT_SYSTEM_CONFIG_DIRECTORY;
+char system_log_dir[PATH_NAME_MAX + 1] = DEFAULT_LOG_DIRECTORY;
+
+//int system_remote_management_flag = DEFAULT_REMOTE_MANAGEMENT_FLAG;
+
+Diags *diags = NULL;
+char debug_tags[1024] = "";
+char action_tags[1024] = "";
+
+int version_flag = 0;
+int tsapp_port = 12345;
+
+AppVersionInfo appVersionInfo;
+
+ArgumentDescription argument_descriptions[] = {
+ {"version", 'V', "Print Version Id", "T",
+ &version_flag, NULL, NULL},
+ {"tsapp_port", 'p', "tsapp port", "I",
+ &tsapp_port, "TSAPP_PORT", NULL},
+ {"net_threads", 'n', "Number of Net Threads", "I",
+ &system_num_of_net_threads, "TSAPP_NET_THREADS", NULL},
+ {"accept_thread", 'a', "Use an Accept Thread", "T",
+ &use_accept_thread, "TSAPP_ACCEPT_THREAD", NULL},
+ {"poll_timeout", 't', "poll timeout in milliseconds", "I",
+ &net_config_poll_timeout, NULL, NULL},
+ {"debug_tags", 'T', "Debug Tags ('|' separated)", "S1023",
+ debug_tags, "TSAPP_DEBUG_TAGS", NULL},
+ {"action_tags", 'T', "Action Tags ('|' separated)", "S1023",
+ action_tags, "TSAPP_ACTION_TAGS", NULL},
+ {"help", 'h', "Help", NULL, NULL, NULL, usage}
+};
+int n_argument_descriptions = SIZE(argument_descriptions);
+
+void init_app_config() {
+
+ // Net
+ RecRegisterConfigInt(
+ RECT_CONFIG,
+ "proxy.config.net.max_poll_delay",
+ 128,
+ RECU_DYNAMIC, RECC_NULL, NULL);
+
+ RecRegisterConfigInt(
+ RECT_CONFIG,
+ "proxy.config.net.listen_backlog",
+ 1024,
+ RECU_DYNAMIC, RECC_NULL, NULL);
+
+ RecRegisterConfigInt(
+ RECT_CONFIG,
+ "proxy.config.net.connections_throttle",
+ 8000,
+ RECU_DYNAMIC, RECC_NULL, NULL);
+
+ RecRegisterConfigInt(
+ RECT_CONFIG,
+ "proxy.config.accept_threads",
+ 0,
+ RECU_DYNAMIC, RECC_NULL, NULL);
+
+ // IO
+ RecRegisterConfigInt(
+ RECT_CONFIG,
+ "proxy.config.io.max_buffer_size",
+ 32768,
+ RECU_DYNAMIC, RECC_NULL, NULL);
+
+ // Cache, etc
+}
+
+// TODO: Move to I_Util.cc file ???
+int
+get_ts_directory(char *ts_path, size_t ts_path_len)
+{
+ FILE *fp;
+ char *env_path;
+ struct stat s;
+ int err;
+
+ if ((env_path = getenv("TS_ROOT"))) {
+ ink_strncpy(ts_path, env_path, ts_path_len);
+ } else {
+ if ((fp = fopen(DEFAULT_TS_DIRECTORY_FILE, "r")) != NULL) {
+ if (fgets(ts_path, ts_path_len, fp) == NULL) {
+ fclose(fp);
+ fprintf(stderr,"\nInvalid contents in %s\n",DEFAULT_TS_DIRECTORY_FILE);
+ fprintf(stderr," Please set correct path in env variable TS_ROOT \n");
+ return -1;
+ }
+ // strip newline if it exists
+ int len = strlen(ts_path);
+ if (ts_path[len - 1] == '\n') {
+ ts_path[len - 1] = '\0';
+ }
+ // strip trailing "/" if it exists
+ len = strlen(ts_path);
+ if (ts_path[len - 1] == '/') {
+ ts_path[len - 1] = '\0';
+ }
+
+ fclose(fp);
+ } else {
+ ink_strncpy(ts_path, PREFIX, ts_path_len);
+ }
+ }
+
+ if ((err = stat(ts_path, &s)) < 0) {
+ fprintf(stderr,"unable to stat() TS PATH '%s': %d %d, %s\n",
+ ts_path, err, errno, strerror(errno));
+ fprintf(stderr," Please set correct path in env variable TS_ROOT \n");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+int
+MyAccept::main_event(int event, void *data) {
+ if (event == NET_EVENT_ACCEPT) {
+ //NetVConnection *netvc = (NetVConnection*)data;
+ NOWARN_UNUSED(data);
+ // allocate continuation to handle this connection/request
+ //
+ // ..handle request, etc
+ //
+ return EVENT_CONT;
+ } else {
+ Fatal("tsapp accept received fatal error: errno = %d", -((int)(intptr_t)data));
+ return EVENT_CONT;
+ }
+}
+
+
+//
+// Shutdown, called from signals interrupt_handler()
+// TODO: rename, consolidate signals stuff, etc
+void
+shutdown_system()
+{
+}
+
+int main(int argc, char * argv[])
+{
+ char ts_path[PATH_NAME_MAX + 1];
+ // build the application information structure
+ appVersionInfo.setup(PACKAGE_NAME,PROGRAM_NAME, PACKAGE_VERSION, __DATE__,
+ __TIME__, BUILD_MACHINE, BUILD_PERSON, "");
+
+ process_args(argument_descriptions, n_argument_descriptions, argv);
+
+ // check for the version number request
+ if (version_flag) {
+ fprintf(stderr, "%s\n", appVersionInfo.FullVersionInfoStr);
+ _exit(0);
+ }
+
+ // Get TS directory
+ if (0 == get_ts_directory(ts_path,sizeof(ts_path))) {
+ ink_strncpy(system_root_dir, ts_path, sizeof(system_root_dir));
+ ink_snprintf(system_config_directory, sizeof(system_config_directory), "%s/etc/trafficserver", system_root_dir);
+ ink_snprintf(system_local_state_dir, sizeof(system_local_state_dir), "%s/var/trafficserver", system_root_dir);
+ ink_snprintf(system_log_dir, sizeof(system_log_dir), "%s/var/log/trafficserver", system_root_dir);
+ }
+
+ if (system_root_dir[0] && (chdir(system_root_dir) < 0)) {
+ fprintf(stderr,"unable to change to root directory \"%s\" [%d '%s']\n", system_root_dir, errno, strerror(errno));
+ fprintf(stderr," please set correct path in env variable TS_ROOT \n");
+ _exit(1);
+ } else {
+ printf("[tsapp] using root directory '%s'\n",system_root_dir);
+ }
+
+ // Diags
+ init_system_diags(debug_tags, NULL);
+ if (is_debug_tag_set("tsapp"))
+ diags->dump(stdout);
+
+ // Config & Stats
+ RecModeT mode_type = RECM_STAND_ALONE;
+ RecProcessInit(mode_type,diags);
+ //RecProcessInitMessage(mode_type);
+
+ signal(SIGPIPE, SIG_IGN); // ignore broken pipe
+
+ init_buffer_allocators();
+
+ // Initialze iocore modules
+ ink_event_system_init(EVENT_SYSTEM_MODULE_VERSION);
+ ink_net_init(NET_SYSTEM_MODULE_VERSION);
+ ink_aio_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
+ ink_cache_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
+ ink_hostdb_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
+ ink_dns_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
+ //ink_split_dns_init(makeModuleVersion(1, 0, PRIVATE_MODULE_HEADER));
+
+ init_app_config(); // initialize stats and configs
+
+ if (!use_accept_thread) {
+ RecInt tmp = 0;
+ RecGetRecordInt("proxy.config.accept_threads",(RecInt*) &tmp);
+ use_accept_thread = (ink32)tmp; \
+ }
+
+ if (initialize_store()) { // cache
+ printf("unable to initialize storage, (Re)Configuration required\n");
+ _exit(0);
+ }
+
+ // Start processors
+ eventProcessor.start(system_num_of_net_threads);
+
+ RecProcessStart();
+
+ init_signals2();
+
+ netProcessor.start();
+
+ dnsProcessor.start();
+
+ if (hostDBProcessor.start() < 0)
+ printf("bad hostdb or storage configuration, hostdb disabled");
+
+ //clusterProcessor.init();
+
+ cacheProcessor.start();
+
+ //udpNet.start(system_num_of_udp_threads); // XXX : broken
+
+ //sslNetProcessor.start(getNumSSLThreads());
+
+ // initialize logging (after event and net processor)
+ //Log::init(system_remote_management_flag ? 0 : Log::NO_REMOTE_MANAGEMENT);
+
+#if !defined(TS_NO_API)
+ //plugin_init(system_config_directory, true); // extensions.config
+#endif
+
+#ifndef TS_NO_API
+ //plugin_init(system_config_directory, false); // plugin.config
+#else
+ //api_init(); // still need to initialize some of the data structure other module needs.
+ //extern void init_inkapi_stat_system();
+ //init_inkapi_stat_system(); // i.e. http_global_hooks
+#endif
+
+ // Create accept continuation
+ MyAccept *a = new MyAccept;
+ a->accept_port = tsapp_port;
+ a->mutex = new_ProxyMutex();
+ Action *act= netProcessor.accept(a, a->accept_port, true);
+
+ RecDumpRecordsHt(RECT_NULL); // debugging, specify '-T "rec.*"' to see records
+
+ Debug("tsapp","listening port %d, started %d ethreads, use_accept_thread (%d), act(%p)\n" ,
+ tsapp_port,system_num_of_net_threads,use_accept_thread, act);
+
+ this_thread()->execute();
+}
+
+
Added: trafficserver/traffic/trunk/example/app-template/app-template.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/app-template/app-template.h?rev=941529&view=auto
==============================================================================
--- trafficserver/traffic/trunk/example/app-template/app-template.h (added)
+++ trafficserver/traffic/trunk/example/app-template/app-template.h Wed May 5 23:15:31 2010
@@ -0,0 +1,49 @@
+/** @file
+
+ A brief file description
+
+ @section license License
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+#ifndef _app_template_h_
+#define _app_template_h_
+
+#include "inktomi++.h"
+
+#define DEFAULT_ROOT_DIRECTORY PREFIX
+#define DEFAULT_LOCAL_STATE_DIRECTORY "var/trafficserver"
+#define DEFAULT_SYSTEM_CONFIG_DIRECTORY "etc/trafficserver"
+#define DEFAULT_LOG_DIRECTORY "var/log/trafficserver"
+#define DEFAULT_TS_DIRECTORY_FILE PREFIX "/etc/traffic_server"
+
+#define DEFAULT_NUMBER_OF_THREADS ink_number_of_processors()
+#define DEFAULT_NUMBER_OF_UDP_THREADS 1
+
+
+struct MyAccept : public Continuation {
+ int accept_port;
+ int main_event(int event, void *netvc);
+
+ MyAccept()
+ { SET_HANDLER(&MyAccept::main_event); }
+
+};
+
+
+#endif
Added: trafficserver/traffic/trunk/example/app-template/records.config.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/app-template/records.config.in?rev=941529&view=auto
==============================================================================
--- trafficserver/traffic/trunk/example/app-template/records.config.in (added)
+++ trafficserver/traffic/trunk/example/app-template/records.config.in Wed May 5 23:15:31 2010
@@ -0,0 +1,73 @@
+#
+#
+# Process Records Config File
+#
+# <RECORD-TYPE> <NAME> <TYPE> <VALUE (till end of line)>
+#
+# RECORD-TYPE: CONFIG, LOCAL
+# NAME: name of variable
+# TYPE: INT, STRING, FLOAT
+# VALUE: Initial value for record
+#
+#
+#
+#
+##############################################################################
+#
+# System Variables
+#
+##############################################################################
+CONFIG proxy.config.bin_path STRING bin
+CONFIG proxy.config.config_dir STRING etc/@PACKAGE@
+CONFIG proxy.config.temp_dir STRING /tmp
+CONFIG proxy.config.syslog_facility STRING LOG_DAEMON
+CONFIG proxy.config.cop.linux_min_swapfree_kb INT 10240
+CONFIG proxy.config.cop.linux_min_memfree_kb INT 10240
+CONFIG proxy.config.system.mmap_max INT 2097152
+CONFIG proxy.config.system.memalign_heap INT 0
+CONFIG proxy.config.exec_thread.autoconfig INT 1
+CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 3.0
+CONFIG proxy.config.exec_thread.limit INT 2
+CONFIG proxy.config.accept_threads INT 1
+
+##############################################################################
+#
+# Net Subsystem
+#
+##############################################################################
+CONFIG proxy.config.net.connections_throttle INT 10000
+ # timeout in seconds for defering the accept, 0 is disabled
+CONFIG proxy.config.net.tcp_accept_defer_timeout INT 0
+
+##############################################################################
+#
+# Socket send/recv buffer sizes (0 == don't call setsockopt() )
+#
+##############################################################################
+CONFIG proxy.config.net.sock_send_buffer_size_in INT 262144
+CONFIG proxy.config.net.sock_recv_buffer_size_in INT 0
+CONFIG proxy.config.net.sock_send_buffer_size_out INT 0
+CONFIG proxy.config.net.sock_recv_buffer_size_out INT 0
+
+##############################################################################
+#
+# Debugging
+#
+##############################################################################
+ # Uses a regular expression to match the debugging topic name, performance
+ # will be affected!
+CONFIG proxy.config.diags.debug.enabled INT 1
+CONFIG proxy.config.diags.debug.tags STRING tsmemcache.*|rec.*
+ # Great for tracking down memory leaks, but you need to use the
+ # ink allocators
+CONFIG proxy.config.dump_mem_info_frequency INT 0
+
+##############################################################################
+#
+# User Overridden Configurations Below
+#
+##############################################################################
+
+
+
+
Modified: trafficserver/traffic/trunk/proxy/Initialize.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Initialize.cc?rev=941529&r1=941528&r2=941529&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Initialize.cc (original)
+++ trafficserver/traffic/trunk/proxy/Initialize.cc Wed May 5 23:15:31 2010
@@ -27,94 +27,392 @@
Created On : Fri Feb 5 18:22:05 1999
Description:
-
****************************************************************************/
#include "inktomi++.h"
+
#include "Diags.h"
-#include "DiagsConfig.h"
-#include "Main.h"
#include "I_EventSystem.h"
#include "I_Net.h"
-#include "ProxyConfig.h"
-#include "ProcessManager.h"
#include "I_Version.h"
-#include "MgmtUtils.h"
-#if (HOST_OS == freebsd)
-#define DEFAULT_NUMBER_OF_THREADS 1
+#include "Initialize.h" // TODO: move to I_Initialize.h ???
+
+
+#define set_rlimit(name,max_it,ulim_it) max_out_limit(#name, name, max_it, ulim_it)
+static rlim_t
+max_out_limit(const char *name, int which, bool max_it = true, bool unlim_it = true)
+{
+ struct rlimit rl;
+
+#if (HOST_OS == linux)
+# define MAGIC_CAST(x) (enum __rlimit_resource)(x)
#else
-#define DEFAULT_NUMBER_OF_THREADS sysconf(_SC_NPROCESSORS_ONLN) // number of Net threads
+# define MAGIC_CAST(x) x
#endif
-#define DEFAULT_REMOTE_MANAGEMENT_FLAG 0
-#define DEFAULT_SYSTEM_CONFIG_DIRECTORY "etc/trafficserver"
-#define DEFAULT_MANAGEMENT_DIRECTORY "etc/trafficserver"
+ if (max_it) {
+ ink_release_assert(getrlimit(MAGIC_CAST(which), &rl) >= 0);
+ if (rl.rlim_cur != rl.rlim_max) {
+#if (HOST_OS == darwin)
+ if (which == RLIMIT_NOFILE)
+ rl.rlim_cur = fmin(OPEN_MAX, rl.rlim_max);
+ else
+ rl.rlim_cur = rl.rlim_max;
+#else
+ rl.rlim_cur = rl.rlim_max;
+#endif
+ ink_release_assert(setrlimit(MAGIC_CAST(which), &rl) >= 0);
+ }
+ }
-char error_tags[1024] = "";
-char action_tags[1024] = "";
-int diags_init = 0;
+ if (unlim_it) {
+ ink_release_assert(getrlimit(MAGIC_CAST(which), &rl) >= 0);
+ if (rl.rlim_cur != RLIM_INFINITY) {
+ rl.rlim_cur = (rl.rlim_max = RLIM_INFINITY);
+ ink_release_assert(setrlimit(MAGIC_CAST(which), &rl) >= 0);
+ }
+ }
+ ink_release_assert(getrlimit(MAGIC_CAST(which), &rl) >= 0);
+ //syslog(LOG_NOTICE, "NOTE: %s(%d):cur(%d),max(%d)", name, which, (int)rl.rlim_cur, (int)rl.rlim_max);
+ return rl.rlim_cur;
+}
+//
+// Initialize operating system related information/services
+//
+void
+init_system_settings(void)
+{
+ // Delimit file Descriptors
+ fds_limit = set_rlimit(RLIMIT_NOFILE, true, false);
-int command_flag = 0;
-int fds_limit = 0;
-int http_accept_port_number = 0;
-int remote_management_flag = DEFAULT_REMOTE_MANAGEMENT_FLAG;
-char management_directory[256] = DEFAULT_MANAGEMENT_DIRECTORY;
-char system_config_directory[PATH_NAME_MAX + 1] = DEFAULT_SYSTEM_CONFIG_DIRECTORY;
-int use_accept_thread = 1;
-int num_of_net_threads = DEFAULT_NUMBER_OF_THREADS;
-int num_of_cache_threads = 1;
-Diags *diags;
-DiagsConfig *diagsConfig;
+ set_rlimit(RLIMIT_STACK,true,true);
+ set_rlimit(RLIMIT_DATA,true,true);
+ set_rlimit(RLIMIT_FSIZE, true, false);
+#ifdef RLIMIT_RSS
+ set_rlimit(RLIMIT_RSS,true,true);
+#endif
+}
-AppVersionInfo appVersionInfo;
+void
+init_system_dirs(void)
+{
+ struct stat s;
+ int err;
-static void initialize_process_manager();
+ if ((err = stat(system_config_directory, &s)) < 0) {
+ // Try 'system_root_dir/etc/trafficserver' directory
+ snprintf(system_config_directory, sizeof(system_config_directory),
+ "%s%s%s%s%s",system_root_dir, DIR_SEP,"etc",DIR_SEP,"trafficserver");
+ if ((err = stat(system_config_directory, &s)) < 0) {
+ fprintf(stderr,"unable to stat() config dir '%s': %d %d, %s\n",
+ system_config_directory, err, errno, strerror(errno));
+ fprintf(stderr, "please set config path via 'proxy.config.config_dir' \n");
+ _exit(1);
+ }
+ }
-static rlim_t
-max_out_limit(int which, bool max_it)
+ if ((err = stat(system_local_state_dir, &s)) < 0) {
+ // Try 'system_root_dir/var/trafficserver' directory
+ snprintf(system_local_state_dir, sizeof(system_local_state_dir),
+ "%s%s%s%s%s",system_root_dir, DIR_SEP,"var",DIR_SEP,"trafficserver");
+ if ((err = stat(system_local_state_dir, &s)) < 0) {
+ fprintf(stderr,"unable to stat() local state dir '%s': %d %d, %s\n",
+ system_local_state_dir, err, errno, strerror(errno));
+ fprintf(stderr,"please set 'proxy.config.local_state_dir'\n");
+ _exit(1);
+ }
+ }
+
+ if ((err = stat(system_log_dir, &s)) < 0) {
+ // Try 'system_root_dir/var/log/trafficserver' directory
+ snprintf(system_log_dir, sizeof(system_log_dir), "%s%s%s%s%s%s%s",
+ system_root_dir, DIR_SEP,"var",DIR_SEP,"log",DIR_SEP,"trafficserver");
+ if ((err = stat(system_log_dir, &s)) < 0) {
+ fprintf(stderr,"unable to stat() log dir'%s': %d %d, %s\n",
+ system_log_dir, err, errno, strerror(errno));
+ fprintf(stderr,"please set 'proxy.config.log2.logfile_dir'\n");
+ _exit(1);
+ }
+ }
+
+}
+
+#if (HOST_OS == linux)
+#include <sys/prctl.h>
+#endif
+
+static int
+set_core_size(const char *name, RecDataT data_type, RecData data, void *opaque_token)
{
- struct rlimit rl;
- ink_release_assert(getrlimit(which, &rl) >= 0);
- if (max_it && rl.rlim_cur != rl.rlim_max) {
- rl.rlim_cur = rl.rlim_max;
- ink_release_assert(setrlimit(which, &rl) >= 0);
+ RecInt size = data.rec_int;
+ struct rlimit lim;
+ bool failed = false;
+
+ NOWARN_UNUSED(opaque_token);
+
+ if (getrlimit(RLIMIT_CORE, &lim) < 0) {
+ failed = true;
+ } else {
+ if (size < 0) {
+ lim.rlim_cur = lim.rlim_max;
+ } else {
+ lim.rlim_cur = (rlim_t) size;
+ }
+ if (setrlimit(RLIMIT_CORE, &lim) < 0) {
+ failed = true;
+ }
+#if (HOST_OS == linux)
+#ifndef PR_SET_DUMPABLE
+#define PR_SET_DUMPABLE 4
+#endif
+ if (size != 0)
+ prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+#endif
+ }
+
+ if (failed == true) {
+ Warning("Failed to set Core Limit : %s", strerror(errno));
}
+ return 0;
+}
+
+void
+init_system_core_size(void)
+{
+ bool found;
+ RecInt coreSize;
+ found = (RecGetRecordInt("proxy.config.core_limit", &coreSize) == REC_ERR_OKAY);
+ if (found == false) {
+ Warning("Unable to determine core limit");
+ } else {
+ RecData rec_temp;
+ rec_temp.rec_int = coreSize;
+ set_core_size(NULL, RECD_INT, rec_temp, NULL);
+ found = (REC_RegisterConfigUpdateFunc("proxy.config.core_limit", set_core_size, NULL) == REC_ERR_OKAY);
+ ink_assert(found);
+ }
+}
- ink_release_assert(getrlimit(which, &rl) >= 0);
- rlim_t ret = rl.rlim_cur;
+void
+init_system_memalign_heap(void)
+{
+ long long ram_cache_max = -1;
+ int enable_preallocation = 1;
+
+ REC_ReadConfigInteger(enable_preallocation, "proxy.config.system.memalign_heap");
+ if (enable_preallocation) {
+ REC_ReadConfigLLong(ram_cache_max, "proxy.config.cache.ram_cache.size");
+ if (ram_cache_max > 0) {
+ if (!ink_memalign_heap_init(ram_cache_max))
+ Warning("Unable to init memalign heap");
+ } else {
+ Warning("Unable to read proxy.config.cache.ram_cache.size var from config");
+ }
+ }
+}
+
+int system_syslog_facility = LOG_DAEMON;
+
+// Reads the syslog configuration variable
+// and sets the global integer for the
+// facility and calls open log with the
+// new facility
+void
+init_system_syslog_log_configure(void)
+{
+ char *facility_str = NULL;
+ int facility;
+
+ REC_ReadConfigStringAlloc(facility_str, "proxy.config.syslog_facility");
+
+ if (facility_str == NULL || (facility = facility_string_to_int(facility_str)) < 0) {
+ syslog(LOG_WARNING, "Bad or missing syslog facility. " "Defaulting to LOG_DAEMON");
+ } else {
+ system_syslog_facility = facility;
+ closelog();
+ openlog("traffic_server", LOG_PID | LOG_NDELAY | LOG_NOWAIT, facility);
+ }
+}
+
+
+/*
+void
+init_system_logging()
+{
+ // iObject::Init();
+ // iLogBufferBuffer::Init();
+}
+*/
- return ret;
+void
+init_system_adjust_num_of_net_threads(void)
+{
+ float autoconfig_scale = 1.0;
+ int nth_auto_config = 1;
+ int num_of_threads_tmp = 1;
+
+ REC_ReadConfigInteger(nth_auto_config, "proxy.config.exec_thread.autoconfig");
+ if (!nth_auto_config) {
+ REC_ReadConfigInteger(num_of_threads_tmp, "proxy.config.exec_thread.limit");
+ if (num_of_threads_tmp <= 0)
+ num_of_threads_tmp = 1;
+ else if (num_of_threads_tmp > MAX_NUMBER_OF_THREADS)
+ num_of_threads_tmp = MAX_NUMBER_OF_THREADS;
+ system_num_of_net_threads = num_of_threads_tmp;
+ if (is_debug_tag_set("threads")) {
+ fprintf(stderr, "# net threads Auto config - disabled - use config file settings\n");
+ }
+ } else { /* autoconfig is enabled */
+ num_of_threads_tmp = system_num_of_net_threads;
+ REC_ReadConfigFloat(autoconfig_scale, "proxy.config.exec_thread.autoconfig.scale");
+ num_of_threads_tmp = (int) ((float) num_of_threads_tmp * autoconfig_scale);
+ if (num_of_threads_tmp) {
+ system_num_of_net_threads = num_of_threads_tmp;
+ }
+ if (unlikely(num_of_threads_tmp > MAX_NUMBER_OF_THREADS)) {
+ num_of_threads_tmp = MAX_NUMBER_OF_THREADS;
+ }
+ if (is_debug_tag_set("threads")) {
+ fprintf(stderr, "# net threads Auto config - enabled\n");
+ fprintf(stderr, "# autoconfig scale: %f\n", autoconfig_scale);
+ fprintf(stderr, "# scaled number of net threads: %d\n", num_of_threads_tmp);
+ }
+ }
+ if (is_debug_tag_set("threads")) {
+ fprintf(stderr, "# number of net threads: %d\n", system_num_of_net_threads);
+ }
+ if (unlikely(system_num_of_net_threads <= 0)) { /* impossible case -just for protection */
+ Warning("Number of Net Threads should be greater than 0");
+ system_num_of_net_threads = 1;
+ }
}
+
+//////////////////////////////////////////////////////////////////////////////
//
-// Initialize operating system related information/services
+// void reconfigure_diags()
+//
+// This function extracts the current diags configuration settings from
+// records.config, and rebuilds the Diags data structures.
//
+//////////////////////////////////////////////////////////////////////////////
void
-init_system()
+init_system_reconfigure_diags(void)
{
- //
- // Delimit file Descriptors
- //
+ int i;
+ DiagsConfigState c;
- fds_limit = max_out_limit(RLIMIT_NOFILE, true);
+ // initial value set to 0 or 1 based on command line tags
+ c.enabled[DiagsTagType_Debug] = (diags->base_debug_tags != NULL);
+ c.enabled[DiagsTagType_Action] = (diags->base_action_tags != NULL);
+
+ c.enabled[DiagsTagType_Debug] = 1;
+ c.enabled[DiagsTagType_Action] = 1;
+ diags->show_location = 1;
+
+ // read output routing values
+ for (i = 0; i < DiagsLevel_Count; i++) {
+
+ c.outputs[i].to_stdout = 0;
+ c.outputs[i].to_stderr = 1;
+ c.outputs[i].to_syslog = 1;
+ c.outputs[i].to_diagslog = 1;
+ }
- max_out_limit(RLIMIT_DATA, true);
- max_out_limit(RLIMIT_FSIZE, true);
-#ifdef RLIMIT_RSS
- max_out_limit(RLIMIT_RSS, true);
+ //////////////////////////////
+ // clear out old tag tables //
+ //////////////////////////////
+ diags->deactivate_all(DiagsTagType_Debug);
+ diags->deactivate_all(DiagsTagType_Action);
+
+ //////////////////////////////////////////////////////////////////////
+ // add new tag tables
+ //////////////////////////////////////////////////////////////////////
+ if (diags->base_debug_tags)
+ diags->activate_taglist(diags->base_debug_tags, DiagsTagType_Debug);
+ if (diags->base_action_tags)
+ diags->activate_taglist(diags->base_action_tags, DiagsTagType_Action);
+
+ ////////////////////////////////////
+ // change the diags config values //
+ ////////////////////////////////////
+#if !defined (_WIN32) && !defined(__GNUC__) && (HOST_OS != hpux)
+ diags->config = c;
+#else
+ memcpy(((void *) &diags->config), ((void *) &c), sizeof(DiagsConfigState));
#endif
+
}
void
+init_system_diags(char *bdt, char *bat)
+{
+ FILE *diags_log_fp = NULL;
+ char diags_logpath[PATH_NAME_MAX + 1];
+
+ ink_snprintf(diags_logpath, sizeof(diags_logpath), "%s%s%s", system_log_dir,DIR_SEP,DIAGS_LOG_FILE);
+
+ diags_log_fp = fopen(diags_logpath, "w");
+ if (diags_log_fp) {
+ int status;
+ status = setvbuf(diags_log_fp, NULL, _IOLBF, 512);
+ if (status != 0) {
+ fclose(diags_log_fp);
+ diags_log_fp = NULL;
+ }
+ }
+
+ diags = NEW(new Diags(bdt, bat, diags_log_fp));
+ if (diags_log_fp == NULL) {
+ SrcLoc loc(__FILE__, __FUNCTION__, __LINE__);
+
+ diags->print(NULL, DL_Warning, NULL, &loc,
+ "couldn't open diags log file '%s', " "will not log to this file", diags_logpath);
+ } else {
+ diags->print(NULL, DL_Status, "STATUS", NULL, "opened %s", diags_logpath);
+ }
+
+ init_system_reconfigure_diags();
+}
+
+
+#if 0 // TODO: remove after api/dir re-org
+
+#define DEFAULT_REMOTE_MANAGEMENT_FLAG 0
+#define DEFAULT_SYSTEM_CONFIG_DIRECTORY "etc/trafficserver"
+#define DEFAULT_MANAGEMENT_DIRECTORY "etc/trafficserver"
+
+char error_tags[1024] = "";
+char action_tags[1024] = "";
+int diags_init = 0;
+
+//int command_flag = 0;
+extern int use_accept_thread;
+int num_of_net_threads = ink_number_of_processors();
+//int num_of_cache_threads = 1;
+
+int remote_management_flag = DEFAULT_REMOTE_MANAGEMENT_FLAG;
+char management_directory[256] = DEFAULT_MANAGEMENT_DIRECTORY;
+char system_config_directory[PATH_NAME_MAX + 1] = DEFAULT_SYSTEM_CONFIG_DIRECTORY;
+
+Diags *diags;
+DiagsConfig *diagsConfig;
+
+AppVersionInfo appVersionInfo;
+
+static void initialize_process_manager();
+
+void
initialize_standalone()
{
init_system();
+
// Define the version info
appVersionInfo.setup(PACKAGE_NAME,"traffic_server", PACKAGE_VERSION, __DATE__,
__TIME__, BUILD_MACHINE, BUILD_PERSON, "");
@@ -122,8 +420,9 @@ initialize_standalone()
initialize_process_manager();
diagsConfig = NEW(new DiagsConfig(error_tags, action_tags));
- diags = diagsConfig->diags; diags_init = 1;
- eventProcessor.start(ink_number_of_processors());
+ diags = diagsConfig->diags;
+ diags_init = 1;
+ eventProcessor.start(num_of_net_threads);
// Set up IO Buffers
int config_max_iobuffer_size = DEFAULT_MAX_BUFFER_SIZE;
@@ -135,77 +434,86 @@ initialize_standalone()
default_small_iobuffer_size = max_iobuffer_size;
if (default_large_iobuffer_size > max_iobuffer_size)
default_large_iobuffer_size = max_iobuffer_size;
- init_buffer_allocators(); netProcessor.start(); return;}
+
+ init_buffer_allocators();
+
+ netProcessor.start();
+
+ return;
+}
//
// Startup process manager
//
void initialize_process_manager()
{
- ProcessRecords * precs; mgmt_use_syslog();
+ ProcessRecords *precs;
+ struct stat s;
+ int err;
+
+ mgmt_use_syslog();
+
// Temporary Hack to Enable Communuication with LocalManager
if (getenv("PROXY_REMOTE_MGMT")) {
- remote_management_flag = true;}
-
+ remote_management_flag = true;
+ }
//
// Remove excess '/'
//
if (management_directory[strlen(management_directory) - 1] == '/')
management_directory[strlen(management_directory) - 1] = 0;
+
+ if ((err = stat(management_directory, &s)) < 0) {
+ // Try 'system_root_dir/etc/trafficserver' directory
+ snprintf(management_directory, sizeof(management_directory),
+ "%s%s%s%s%s",system_root_dir, DIR_SEP,"etc",DIR_SEP,"trafficserver");
+ if ((err = stat(management_directory, &s)) < 0) {
+ fprintf(stderr,"unable to stat() management path '%s': %d %d, %s\n",
+ management_directory, err, errno, strerror(errno));
+ fprintf(stderr,"please set management path via command line '-d <managment directory>'\n");
+ _exit(1);
+ }
+ }
+
+ RecProcessInit(remote_management_flag ? RECM_CLIENT : RECM_STAND_ALONE, diags);
+
+ if (!remote_management_flag) {
+ LibRecordsConfigInit();
+ }
//
// Start up manager
//
- char rstr[] = "records.config";
- char lstr[] = "lm.config";
- precs = NEW(new ProcessRecords(management_directory, rstr, lstr));
- pmgmt = NEW(new ProcessManager(remote_management_flag, management_directory,
- precs));
- ReadConfigString(system_config_directory, "proxy.config.config_dir", PATH_NAME_MAX);
- //
- // Define version info records
- //
- precs->setString("proxy.process.version.server.short",
- appVersionInfo.VersionStr);
- precs->setString("proxy.process.version.server.long",
- appVersionInfo.FullVersionInfoStr);
- precs->setString("proxy.process.version.server.build_number",
- appVersionInfo.BldNumStr);
- precs->setString("proxy.process.version.server.build_time",
- appVersionInfo.BldTimeStr);
- precs->setString("proxy.process.version.server.build_date",
- appVersionInfo.BldDateStr);
- precs->setString("proxy.process.version.server.build_machine",
- appVersionInfo.BldMachineStr);
- precs->setString("proxy.process.version.server.build_person", appVersionInfo.BldPersonStr);
- // precs->setString("proxy.process.version.server.build_compile_flags",
- // appVersionInfo.BldCompileFlagsStr);
-}
+ precs = NEW(new ProcessRecords(management_directory, "records.config", 0));
+ pmgmt = NEW(new ProcessManager(remote_management_flag, management_directory, precs));
-void clear_http_handler_times()
-{
- return;}
+ pmgmt->start();
-void initialize_thread_for_icp(EThread * thread)
-{
- (void) thread; return;}
+ RecProcessInitMessage(remote_management_flag ? RECM_CLIENT : RECM_STAND_ALONE);
-void initialize_thread_for_ftp(EThread * thread)
-{
- (void) thread; return;}
+ pmgmt->reconfigure();
-void initialize_thread_for_cluster(EThread * thread)
-{
- (void) thread;}
+ init_system_dirs();// setup directories
-// void syslog_thr_init()
-//
-// On the alpha, each thread must set its own syslog
-// parameters. This function is to be called by
-// each thread at start up. It inits syslog
-// with stored facility information from system
-// startup
-//
-void syslog_thr_init()
-{
+ //
+ // Define version info records
+ //
+ RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.short", appVersionInfo.VersionStr, RECP_NULL);
+ RecRegisterStatString(RECT_PROCESS,
+ "proxy.process.version.server.long", appVersionInfo.FullVersionInfoStr, RECP_NULL);
+ RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_number", appVersionInfo.BldNumStr, RECP_NULL);
+ RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_time", appVersionInfo.BldTimeStr, RECP_NULL);
+ RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_date", appVersionInfo.BldDateStr, RECP_NULL);
+ RecRegisterStatString(RECT_PROCESS,
+ "proxy.process.version.server.build_machine", appVersionInfo.BldMachineStr, RECP_NULL);
+ RecRegisterStatString(RECT_PROCESS,
+ "proxy.process.version.server.build_person", appVersionInfo.BldPersonStr, RECP_NULL);
+ // RecRegisterStatString(RECT_PROCESS,
+ // "proxy.process.version.server.build_compile_flags",
+ // appVersionInfo.BldCompileFlagsStr,
+ // RECP_NULL);
}
+
+#endif
+
+
Modified: trafficserver/traffic/trunk/proxy/Initialize.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Initialize.h?rev=941529&r1=941528&r2=941529&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Initialize.h (original)
+++ trafficserver/traffic/trunk/proxy/Initialize.h Wed May 5 23:15:31 2010
@@ -34,6 +34,25 @@
#if !defined (_Initialize_h_)
#define _Initialize_h_
-void initialize_standalone();
+#define MAX_NUMBER_OF_THREADS 1024
+#define DIAGS_LOG_FILE "diags.log"
+
+extern Diags *diags;
+extern int fds_limit; // TODO: rename
+extern int system_num_of_net_threads;
+extern int system_syslog_facility;
+
+void init_system_settings(void);
+void init_system_dirs(void);
+void init_system_core_size(void);
+void init_system_memalign_heap(void);
+void init_system_syslog_log_configure(void);
+//void init_system_logging();
+void init_system_reconfigure_diags(void);
+void init_system_diags(char *bdt, char *bat);
+
+void init_system_adjust_num_of_net_threads(void);
+
+//void initialize_standalone();
#endif
Modified: trafficserver/traffic/trunk/proxy/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Makefile.am?rev=941529&r1=941528&r2=941529&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Makefile.am (original)
+++ trafficserver/traffic/trunk/proxy/Makefile.am Wed May 5 23:15:31 2010
@@ -389,7 +389,7 @@ versiondir = $(DESTDIR)$(pkglocalstatedi
dist_version_DATA = TS_version
install-data-local:
- $(INSTALL) -d -o $(pkgsysuser) -g $(pkgsysgroup) $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(pkglogdir) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgsysconfdir)/internal
+ $(INSTALL) -d -o $(pkgsysuser) -g $(pkgsysgroup) $(DESTDIR)$(pkglocalstatedir) $(DESTDIR)$(pkglogdir) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgsysconfdir)/internal $(DESTDIR)$(pkgdatadir)
install-data-hook:
chown -R $(pkgsysuser):$(pkgsysgroup) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(pkgdatadir)