You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/12/17 01:02:36 UTC

[1/2] git commit: Improve plugin.config documentation

Updated Branches:
  refs/heads/master 730320977 -> 6ce376a8f


Improve plugin.config documentation


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

Branch: refs/heads/master
Commit: 49bb787a7d83105e9f20047a43411b0c8db2611c
Parents: 7303209
Author: James Peach <jp...@apache.org>
Authored: Mon Dec 16 09:29:47 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Dec 16 16:01:36 2013 -0800

----------------------------------------------------------------------
 .../configuration/plugin.config.en.rst          | 52 ++++++++++++++------
 1 file changed, 38 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49bb787a/doc/reference/configuration/plugin.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/plugin.config.en.rst b/doc/reference/configuration/plugin.config.en.rst
index 9a5afa6..f846a2e 100644
--- a/doc/reference/configuration/plugin.config.en.rst
+++ b/doc/reference/configuration/plugin.config.en.rst
@@ -21,10 +21,39 @@ plugin.config
 
 .. configfile:: plugin.config
 
-The :file:`plugin.config` file controls run-time loadable plugins available
-to the Traffic Server, as well as their configuration.
+Description
+===========
 
-Example
+The :file:`plugin.config` file controls run-time loadable plugins
+available to the Traffic Server, as well as their configuration.
+Plugins listed in this file are referred to as `global plugins`
+because they are always loaded and have global effect.  This is in
+contrast to plugins specified in :file:`remap.config`, whose effects
+are limited to the specific mapping rules they are applied to.
+
+Each configuration line consists of a path to an ``.so`` file. This
+path can either be absolute, or relative to the plugin directory
+(usually ``/usr/local/libexec/trafficserver``).  Failure to load a
+plugin is fatal, and will cause Traffic Server to abort. In general,
+it is not possible to know whether it is safe for the service to
+run without a particular plugin, since plugins can have arbitrary
+effects on caching and authorization policies.
+
+Plugins should only be listed once. The order in which the plugins
+are listed is also the order in which they are chained for request
+processing.
+
+An option list of whitespace-separated arguments may follow the
+plugin name. These are passed as an argument vector to the plugin's
+initialization function, :func:`TSPluginInit`. Arguments that begin
+with the ``$`` character designate Traffic Server configuration
+variables. These arguments will be replaced with the value of the
+corresponding configuration variable before the plugin is loaded.
+When using configuration variable expansion, note that most Traffic
+Server configuration can be changed. If a plugin requires the current
+value, it must obtain that using the management API.
+
+Examples
 =======
 
 ::
@@ -36,16 +65,11 @@ Example
      #
      plugins/iwx/iwx.so
      plugins/abuse/abuse.so etc/trafficserver/abuse.config
-     plugins/icx/icx.so etc/trafficserver/icx.config
-
-Each configuration line consists of a path to an ``.so`` file. This path
-can either be absolute, or relative to the plugin-directory (usually
-``/usr/local/libexec/trafficserver``). Such a line tells Traffic Server
-to load said plugin.
-
-A plugin can have any number of configuration parameters listed. Please
-refer to our `plugins' documentation <../plugins>`_ for their reference.
+     plugins/icx/icx.so etc/trafficserver/icx.config $proxy.config.http.connect_attempts_timeout
 
-Plugins should only be listed *once*. The order in which the plugins are
-listed is also the order in which they are chained for the processing.
+See also
+========
 
+:manpage:`TSAPI(3ts)`,
+:manpage:`TSPluginInit(3ts)`,
+:manpage:`remap.config(5)`


[2/2] git commit: TS-2434: use FATAL error level to handle plugin errors

Posted by jp...@apache.org.
TS-2434: use FATAL error level to handle plugin errors


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

Branch: refs/heads/master
Commit: 6ce376a8f2f027d329f4b1a1f79d75c1ed4a7dcf
Parents: 49bb787
Author: James Peach <jp...@apache.org>
Authored: Mon Dec 16 09:33:39 2013 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Dec 16 16:02:08 2013 -0800

----------------------------------------------------------------------
 CHANGES         | 2 ++
 proxy/Plugin.cc | 7 ++-----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6ce376a8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a0f5bb6..669fe9b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2434] Use the FATAL error level to handle plugin errors.
+
   *) [TS-2203] Clarify syslog startup messages for standalone log programs.
 
   *) [TS-2436] Add a simple integration test harness.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6ce376a8/proxy/Plugin.cc
----------------------------------------------------------------------
diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc
index 10ff423..b75fa52 100644
--- a/proxy/Plugin.cc
+++ b/proxy/Plugin.cc
@@ -120,8 +120,7 @@ plugin_load(int argc, char *argv[])
 
   handle = dll_open(path);
   if (!handle) {
-    Error("unable to load '%s': %s", path, dll_error(handle));
-    abort();
+    Fatal("unable to load '%s': %s", path, dll_error(handle));
   }
 
   // Allocate a new registration structure for the
@@ -132,9 +131,7 @@ plugin_load(int argc, char *argv[])
 
   init = (init_func_t) dll_findsym(handle, "TSPluginInit");
   if (!init) {
-    Error("unable to find TSPluginInit function '%s': %s", path, dll_error(handle));
-    dll_close(handle);
-    abort();
+    Fatal("unable to find TSPluginInit function '%s': %s", path, dll_error(handle));
   }
 
   // elevate the access to read files as root if compiled with capabilities, if not