From: Arno Töll Date: Wed, 23 Jul 2014 15:43:00 +0000 (+0000) Subject: Import trafficserver_5.0.1-1.debian.tar.xz X-Git-Tag: archive/raspbian/8.0.2+ds-1+rpi1~1^2^2^2^2^2^2^2^2^2^2^2^2^2^2~1^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b1882a7d72bd82b940b70f49dc0475ac8c5da88b;p=trafficserver.git Import trafficserver_5.0.1-1.debian.tar.xz [dgit import tarball trafficserver 5.0.1-1 trafficserver_5.0.1-1.debian.tar.xz] --- b1882a7d72bd82b940b70f49dc0475ac8c5da88b diff --git a/CONFIGURATION.Debian b/CONFIGURATION.Debian new file mode 100644 index 00000000..a8a2b498 --- /dev/null +++ b/CONFIGURATION.Debian @@ -0,0 +1,99 @@ +trafficserver for Debian +------------------------ + +Here are some configuration hints related to Traffic Server. Unless you already +noted, configuration files are located in /etc/trafficserver. Traffic Server +has some uncommon behaviour here: Please note, those files are generated auto- +matically and some may not even be intended to be edited manually. Moreover it +will rotate and synchronize configuration files if you run a cluster. Hence be +careful when editing them, chances are Traffic Server WILL OVERWRITE them. This +is especially true for comments which are not kept when using `traffic_line' +(as explained below). + +* To get a general idea about traffic server and its architecture, read [4]. It + is crucial to understand the internal architecture before trying to start. + +* The main configuration file is `records.config'. You may either edit the main + configuration file by hand, but it is suggested to use the `traffic_line' + command instead. More on editing configuration files can be found on [1]. The + `traffic_line' command is used like this: + + traffic_line -s proxy.config.proxy_name -v www.example.com + + You might need to tell Traffic Server about your changes. If it is already + running use `traffic_line -x' to inform it about your changes. Please note + that you must restart your `traffic_server' daemon for some changes. + +* If you used Squid before you might find [2] helpful which lists Traffic Serv- + er configuration directives along their Squid equivalent. Use this as resour- + ce to understand Traffic Server. + +* To help you to get started, I am going to introduce you very briefly to Traf- + fic Server. Note, lines starting with `#' are remarks: + + Open `records.config'. + + # Configure the cluster interface + CONFIG proxy.config.cluster.ethernet_interface STRING eth0 + + + # You may also want to bind your proxy server to a specific IP: + # Please note the security warning below as well + CONFIG proxy.local.incoming_ip_to_bind 1.2.3.4 + + # Next configure the listening port for incoming connections + CONFIG proxy.config.http.server_port INT 80 + + # Now tell Traffic Server how much Memory it is allowed to consume + # Set this value to -1 for best results which will instruct Traffic Server + # to consume roughly 1 MB for each GB of your disk backend storage size + # for memory caching. If you can afford it, go on and trash as much as + # you want and put here any positive value indicating the memory cache + # in bytes. + CONFIG proxy.config.cache.ram_cache.size LLONG 131072 # (128 MB) + + Next edit `storage.config'. Debian ships with a default configuration poin- + ting to a cache file in `/var/cache/trafficserver' sized 256MB. This is fair- + ly ok for testing, otherwise feel free to change (value is in KB): + + /var/cache/trafficserver 262144 + + Finally open `remap.config' where you need to tell Traffic Server about + your origin server(s): + + map http://www.example.com/ http://www.example.com:8080/ + # ---------------------- ---------------------------- + # ^- This is your client This is your origin -^ + # Host: header that server. + # is to be mappend + +* For a more comprehensive documentation about Traffic Server and its configu- + ration directives consult [3]. + + Yet the documentation on the web page can not be considered up to date for some + parts. Feel free to ask for help on the Apache Traffic Server mailing list: + + E-Mail + URL: + + More information may be found on either resource among those: + Project Website: + IRC: #traffic-server on irc.freenode.net. + Project Wiki: https://cwiki.apache.org/TS/traffic-server.html + +* Traffic Server can basically act in two modes: As forward proxy and as a rever- + se proxy. Traffic Servers primary purpose is to act as reverse proxy (e.g. + different to Squid). Nonetheless you can Traffic Server still instruct to act + as forward proxy as well. If you know what you are doing, you need to set + + CONFIG proxy.config.url_remap.remap_required INT 0 + + for that purpose. + + +[1] http://trafficserver.apache.org/docs/v2/admin/configure.htm +[2] https://cwiki.apache.org/TS/squidconfigtranslation.html +[3] http://trafficserver.apache.org/docs/v2/admin/files.htm#records.config +[4] http://trafficserver.apache.org/docs/v2/admin/intro.htm + + -- Arno Töll Wed, 21 Mar 2012 14:10:21 +0100 diff --git a/NEWS b/NEWS new file mode 100644 index 00000000..f5181ed3 --- /dev/null +++ b/NEWS @@ -0,0 +1,12 @@ +trafficserver (3.0.0-1) unstable; urgency=low + + * If you are upgrading from v2.1.8 or earlier to ATS 3.0 you need to migrate + to the new `records.config' configuration file. If possible, let Debian + overwrite your `records.config' configuration file. + * Moreover you should clear all caches after upgrading (e.g. do "traffic_server + -Cclear"). + * The host.db data abse isn't required anymore. Therefore you can delete + `/etc/trafficserver/internal/hostdb.config' and `/var/cache/trafficserver/ + host.db'. + + -- Arno Töll Wed, 15 Jun 2011 16:23:13 +0200 diff --git a/README.Debian b/README.Debian new file mode 100644 index 00000000..f518724e --- /dev/null +++ b/README.Debian @@ -0,0 +1,15 @@ +trafficserver for Debian +------------------------ + +* Please read the CONFIGURATION.Debian file to get started with Traffic Server. + +* Currently Apache Traffic Server lacks man pages of binaries shipped along the + package. That's a known problem which is being worked on. Please read the + upstream documentation on the website instead. + +* If you read upstream's documentation about Traffic Server you will sometimes + find references to a program `/usr/bin/trafficserver`. Debian does not ship + this script. This is intentional. Use Debian's /etc/init.d/trafficserver + script instead. + + -- Arno Töll Tue, 31 Dec 2011 13:54:18 +0100 diff --git a/README.conf-remap.Debian b/README.conf-remap.Debian new file mode 100644 index 00000000..28d9e4dc --- /dev/null +++ b/README.conf-remap.Debian @@ -0,0 +1,26 @@ +Trafficserver-plugin-conf-remap for Debian +----------------------------------------- + +* The conf_remap plug-in allows you to override configuration directives + dependent on actual remapping rules. +* This plug-in replaces older legacy functionality which allowed to achieve a + similar behaviour previously by configuring remap rules for example with + switches like "@pristine_host_hdr=1" in your remap configuration. +* If you want to achieve this behaviour now, configure a remap rule like this: + + map http://cdn.example.com/ http://some-server.example.com \ + @plugin=conf_remap.so @pparam=/etc/trafficserver/cdn.conf + + where cdn.conf would look like records.config, e.g. + + CONFIG proxy.config.url_remap.pristine_host_hdr INT 1 + + Doing this, you will override your global default configuration on a per map- + ping rule. + +* You may want to look on + + for a full list of options which are allowed to be overridden and perhaps + some updated information. + + -- Arno Toell Tue, 12 Jan 2011 19:30:18 +0100 diff --git a/change_config.pl b/change_config.pl new file mode 100755 index 00000000..f5db41be --- /dev/null +++ b/change_config.pl @@ -0,0 +1,31 @@ +#! /usr/bin/perl + +use strict; + +our @config_lines; +our %defaults = ( + "proxy.config.alarm_email" => "trafficserver", + "proxy.config.admin.user_id" => "trafficserver", + "proxy.config.log.max_space_mb_for_logs" => 2000, +); + +die("Usage: $0 ") unless $#ARGV == 0; + +open(F, "+<", $ARGV[0]) || die("Cannot open $ARGV[0]: $!"); +while(my $line = ) +{ + if ($line =~ /^CONFIG/) + { + foreach my $pattern (keys %defaults) + { + $line =~ s/(?<=CONFIG $pattern)(\s+[A-Z]+)\s+.+$/$1 $defaults{$pattern}/; + } + } + push(@config_lines, $line); +} +seek(F, 0, 0); +foreach my $line (@config_lines) +{ + print F $line; +} +close(F); diff --git a/changelog b/changelog new file mode 100644 index 00000000..d9ad1253 --- /dev/null +++ b/changelog @@ -0,0 +1,308 @@ +trafficserver (5.0.1-1) unstable; urgency=medium + + * New upstream release including a fix for CVE-2014-3525 that allowed + attackers by special crafted packets to obtain privileges for services bound + to localhost + + -- Arno Töll Wed, 23 Jul 2014 04:43:00 -1100 + +trafficserver (5.0.0-1) unstable; urgency=medium + + * Acknowledge previous NMUs, thanks to Anibal Monsalve Salazar for + coordination. + * New upstream version. Patch changes: + + drop 0001-TS-1821.patch: released upstream in 5.0.0 + + drop 0001-TS-2454-Fix-undefined-reference-to-__sync_fetch_and_.patch: + released upstream in 4.2 + + drop add-mips-support.patch: released upstream in 5.0.0 + + drop pthread_setname_np.patch: This was a Debian specific issue which is + being worked around in eglibc's commit r5460. + * Add "support for mips64": merged upstream (Closes: #750807) + * Build with dh-autoreconf to avoid build time issues with Automake 1.13 + which is not in Debian yet. + + -- Arno Töll Sun, 06 Jul 2014 00:20:59 -1100 + +trafficserver (4.1.2-1.2) unstable; urgency=medium + + * Non-maintainer upload. + * Add missing prototype for pthread_setname_np() + Add pthread_setname_np.patch + Patch by Petr Salinger + Closes: #743584 + + -- Anibal Monsalve Salazar Fri, 04 Apr 2014 08:59:48 +0100 + +trafficserver (4.1.2-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Fix undefined reference to `__sync_fetch_and_sub_8' on ARM 32bit + Add 0001-TS-2454-Fix-undefined-reference-to-__sync_fetch_and_.patch + from https://issues.apache.org/jira/browse/TS-2454 + Patch by Yunkai Zhang + * Add support for MIPS + Add add-mips-support.patch + Submitted: https://issues.apache.org/jira/browse/TS-2687 + Merged: https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=2f81790 + Patch by Dejan Latinovic + Closes: 743395 + * Build-depend on libboost-dev + Patch by Dejan Latinovic + Closes: #737510 + + -- Anibal Monsalve Salazar Thu, 03 Apr 2014 04:18:23 +0100 + +trafficserver (4.1.2-1) unstable; urgency=medium + + * Merge the experimental branch of trafficserver to unstable + * New upstram release (Closes: #711530, #733377) + + Refresh 0001-TS-1821.patch until it is fixed upstream + + Don't run autoreconf anymore, we do not need it anymore + + build depend on libaio-dev to support AIO on Linux systems + * Push standards version + + -- Arno Töll Wed, 29 Jan 2014 03:01:12 -1100 + +trafficserver (3.3.2-1) experimental; urgency=low + + [ Arno Töll ] + * Drop --with-arg-max from configure + * Update changelog in view of the new upstream version + + [ Aron Xu ] + * Imported Upstream version 3.3.2 + * Drop patch for enabling experimental plugins + * Add liblua5.1-dev and liboost1.53-dev to B-D + * Try on all archs for experimental builds + * Permit parallel building + * Fix typo in dep5 copyright file + * Do not install staticly linked library + * Enable Linux native AIO support for linux-any + * Enable reclaimable freelist + + -- Aron Xu Thu, 09 May 2013 01:00:04 +0800 + +trafficserver (3.3.0+git20121208-0exp1) experimental; urgency=low + + * Upstream git snapshot. + * Enable most of experimental plugins, install related libraries. + * Run dh_autoreconf. + * Make dh_auto_test errors non-fatal. + + -- Aron Xu Thu, 06 Dec 2012 23:32:25 +0800 + +trafficserver (3.3.0-1) experimental; urgency=low + + * Upload upstream development release to experimental. + + -- Aron Xu Thu, 29 Nov 2012 22:13:55 +0800 + +trafficserver (3.2.5-1) unstable; urgency=low + + * New upstream release + + Fix FTBFS on ARM (Closes: #691179) + + Fix FTBS with gcc 4.8 (Closes: #701427) + * Promote trafficserver to depend for trafficserver-dev to fix a broken + library symlink. The library is not required for all users, but those who + need it don't need to install it manually anymore (Closes: #715134) + + -- Arno Töll Sun, 21 Jul 2013 11:55:38 +0200 + +trafficserver (3.2.4-1) unstable; urgency=low + + * New upstream release + + Delete upstream's .gitignore file in our source tree + * Switch packaging repository to Git. + + Add gbp.conf file for those using git-buildpackage + * Fix "Upgrade fails if purging of cache fails" by not dying in a fire when + the postinst fails to purge the cache (Closes: #687698) + * Drop --with-arg-max from ./configure, it's not needed anymore. + + -- Arno Töll Tue, 29 Jan 2013 23:54:44 +0100 + +trafficserver (3.2.0-1) unstable; urgency=low + + * New upstream release + + If you are using SSL or HTTP filtering, please update your configuration. + proxy.config.http.quick_filter.mask and + proxy.config.ssl.server.cert.filename is not recognized anymore. Please + use ip_allow.config and ssl_multicert.config respectively instead. + There is no automated migration for this in Debian, as this affects your + site-specific configuration files. + + See https://cwiki.apache.org/confluence/display/TS/Upgrading+to+3.2 for + full upgrade instructions. + * Upstream decided to ship more plug-ins with the trafficserver core + distribution. These are all bundled into the main package now. Therefore, + the trafficserver-plugin-conf-remap package is not provided anymore. + * Update the default configuration file to ship with more moderate values + for the log configuration. + * Now do start ATS by default for fresh installations. The default + out-of-the box configuration is much more secure than past defaults. + * Purge the host and data cache on upgrades + * Let's welcome Aron Xu to the Uploaders of Trafficserver. Hi Aron! :) + + -- Arno Töll Fri, 14 Sep 2012 22:56:29 +0200 + +trafficserver (3.0.5-1) unstable; urgency=low + + * New upstream release. + * No kudos for the previous hostile NMU, but include the changelog to denote + this upload does not introduce a regression. + * Update my maintainer address + * Make the init script look much better when using fancy outputs. + * Fix "status" output of the init script + * Remove "DM-Upload-Allowed". I don't need that flag anymore. + + + -- Arno Töll Sat, 09 Jun 2012 18:48:23 +0200 + +trafficserver (3.0.4-1.1) unstable; urgency=low + + * Non maintainer upload + * Fix build failure with GCC 4.7. Closes: #667396. + + -- Matthias Klose Wed, 30 May 2012 04:40:28 +0000 + +trafficserver (3.0.4-1) unstable; urgency=high + + * New upstream release + + Fix CVE-2012-0256: A request with a very large Host header caused ATS to + crash. + * Setting urgency to high because of security updates + * Push standards to 3.9.3 - no further changes + * Stilistic adaptions in debian/copyright, but not content changes + * Remove cluster interface warning from README.Configuration. ATS now binds on + lo by default + + -- Arno Töll Wed, 21 Mar 2012 12:34:35 +0100 + +trafficserver (3.0.2-1) unstable; urgency=low + + * New upstream release + + Includes former Debian specific patch which makes sure the upstream + configure script does not override any -O flags passed by the user + anymore. + * Adapt to dpkg 1.16.1 API changes regarding build flags. This enables + hardening build flags. This means, trafficserver is now being built with + -fstack-protector and other security related build flags. + * Add dpkg-dev (>= 1.16.1~) to build-depends to make sure our buildflags are + properly supported. That's guaranteed for Testing, but might be helpful to + know for backporters. + * Fix several issues in the DEP-5 syntax. Unfortunately there is no way to + express that a file is subject to different license agreements so far. + * Do not install the upstream changelog twice anymore + * Finally run regression checks again, now as build failures are sorted out. + + -- Arno Töll Sun, 11 Dec 2011 00:45:45 +0100 + +trafficserver (3.0.1-2) unstable; urgency=low + + * Fix "please add armhf to the arch list" - add armhf to the list of supported + architectures. Thanks Konstantinos Margaritis for the hint (Closes: #636338) + * Remove IA64 from the list of supported architectures. The upgrade to the gcc + 4.6 toolchain disclosed portability issues with it, which caused the resul- + ting binary package to produce no-op code in some functions. + + -- Arno Töll Tue, 02 Aug 2011 22:58:37 +0200 + +trafficserver (3.0.1-1) unstable; urgency=low + + * New upstream release. Fixes several important issues which caused + `traffic_cop' and `traffic_server' to crash. + * Fix "FTBFS with ld --as-needed" re-order libraries upon linkage, patch + committed upstream. Thanks Ilya Barygin (Closes: #632546) + * Fix "trafficserver: Getting rid of unneeded *.la / emptying + dependency_libs", remove *.la files from the installation target completely + (Closes: #633192) + * Set "DM-Upload-Allowed: yes" in agreement with Asheesh Laroia + + + -- Arno Töll Mon, 01 Aug 2011 19:29:58 +0200 + +trafficserver (3.0.0-1) unstable; urgency=low + + * New upstream release. Major changes (since 2.1.9): + + `traffic_server' won't crash anymore when using non-existent plugin in + remap rule + + Don't cache HTTP 401, 303 and 407 error responses anymore, when negative + caching is enabled. + * Re-enable kfreebsd support, it was accidentally not available in + 2.1.9-unstable-1 because of non installable dependencies, as libcap-dev is + installable (and required) on Linux only + * debian/rules: + + Simplify dh_auto_configure flags (upstream incorporated our build layout) + + Enable WCCP (Web Cache Communication Protocol; Linux only) + * debian/control: + + Add flex and bison to build dependencies, both are required for WCCP + (Linux only) + + -- Arno Töll Wed, 15 Jun 2011 15:56:29 +0200 + +trafficserver (2.1.9-unstable-1) unstable; urgency=low + + * New upstream release. Major features (since 2.1.8): + + Bring back support for $DESTDIR and "make check" which makes Debian + patches obsolete + + Allow larger working sets than 512G + + Disable cluster autodiscovery when cluster mode is disabled + + Cleanup `records.config' + + Disable SSLv2 by default + * debian/control: Add build dependency to libcap-dev, because when running + traffic_server standalone, it is unable to bind restricted ports otherwise + (Upstream: TS-804) + * debian/rules: + + Remove override for dh_clean, but put options to debian/source/options + instead + + Remove DH_OPTIONS (unused anyway) + * Source package: Minor change to improving package quality and usability + (i.e. grammar, verbosity of comments) + * Make the init script more robust + * Base the origin of the package source on the untouched upstream tarball, + instead of the versioned SVN branch. + * Bring back IA64 support, this time actually working (upstream merged my + patch TS-783) + * Remove patch `build-quirks.patch'. Changes have been committed upstream + by now. + + -- Arno Töll Tue, 31 May 2011 21:56:12 +0200 + +trafficserver (2.1.8-unstable-1) unstable; urgency=low + + * New upstream release. Major features (since 2.1.5): + + Many bug fixes (none reported in Debian's BTS) + + Set source address for origin Servers + + Major API changes for the SDK + + Provide traffic_logstats + + traffic_shell does not hang anymore on any command + * Fix "FTBFS on architectures not supported upstream": (Closes: #622800) + + Don't execute regression checks for now (fixes x86) + + Upstream merges a Debian patch originally for 2.1.7 which enables + kFreeBSD support (originally provided by myself) + + Restrict Architectures (drop S390, IA64, MIPS[EL], PPC, SPARC) + * Remove ts-ui-disable-conf.patch (applied upstream) + * Update `build-quirks.patch' to make TS handle $DESTDIR correctly + (upstream: TS-759) + * Remove .deps from SDK binary package examples (they were incidentally + included before). + * Fix permissions for /var/cache/trafficserver in postinst + * Bump standards to 3.9.2, depend on debhelper 8.0, adapt VCS links + * Simplify debian/rules + + -- Arno Töll Thu, 05 May 2011 21:49:52 +0200 + +trafficserver (2.1.5-unstable-1) unstable; urgency=low + + * Initial release (Closes: #609285) + * Added some configuration and informational hints + * New upstream release. Major features: + + Better AMD64 support + + Override configuration per transaction + + IPv6 + + Support ARM architectures + + SDK-API changes + * Differences to upstream version: + + Ship some documentation. Well, really a few hints + + Split source into three packages (core, plug-in, SDK) + + Ship our own init script + + -- Arno Toell Tue, 13 Jan 2011 11:49:18 +0100 diff --git a/compat b/compat new file mode 100644 index 00000000..45a4fb75 --- /dev/null +++ b/compat @@ -0,0 +1 @@ +8 diff --git a/control b/control new file mode 100644 index 00000000..789174f4 --- /dev/null +++ b/control @@ -0,0 +1,42 @@ +Source: trafficserver +Section: web +Priority: extra +Maintainer: Arno Töll +Uploaders: Aron Xu +Build-Depends: debhelper (>= 8.0), libssl-dev, tcl-dev, libexpat1-dev, + libpcre3-dev, libtool, libaio-dev [linux-any], libcap-dev [linux-any], + bison [linux-any], flex [linux-any], dpkg-dev (>= 1.16.1~), pkg-config, + libgeoip-dev, liblua5.1-0-dev, dh-autoreconf, libboost-dev, python-sphinx +Standards-Version: 3.9.5 +Homepage: http://trafficserver.apache.org/ +Vcs-Git: git://anonscm.debian.org/collab-maint/trafficserver.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/trafficserver.git;a=summary + +Package: trafficserver +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.2-14), adduser, + ${perl:Depends} +Provides: trafficserver-plugin-conf-remap +Replaces: trafficserver-plugin-conf-remap (<< 3.2~) +Breaks: trafficserver-plugin-conf-remap (<< 3.2~) +Description: fast, scalable and extensible HTTP/1.1 compliant caching proxy server + This package provides the Apache Traffic Server. A fast, scalable reverse + proxy server which may operate as forward proxy as well. Apache Traffic Server + supports: + . + * Caching: Improves response time by caching and reusing frequently- + requested web content. + * Proxying: Supports filtering, anonymization, load balancing and more. + * Scaling: Scales well on modern SMP hardware. + * Extensions: Use the API to modify anything from the HTTP headers to your + own cache algorithm. + +Package: trafficserver-dev +Architecture: any +Depends: ${misc:Depends} +Suggests: trafficserver (= ${binary:Version}) +Description: Apache Traffic Server Software Developers Kit (SDK) + This package provides the Apache Traffic Server Software Developers Kit. + This is a collection of development header and bindings for the C programming + language, the tsxs linking helper and examples to write your own plug-ins for + the Apache Traffic Server. diff --git a/copyright b/copyright new file mode 100644 index 00000000..ec88937a --- /dev/null +++ b/copyright @@ -0,0 +1,201 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Traffic Server +Upstream-Contact: dev@trafficserver.apache.org +Source: http://trafficserver.apache.org/ + + +Files: debian/* +Copyright: 2011 Arno Töll +License: Apache-2.0 +Comment: Packaging for Debian was done by Arno Toell, and I hereby grant + distribution of it under the same terms as Apache Traffic Server itself. + +Files: * +Copyright: 2010 - 2011 The Apache Software Foundation + 2009 Yahoo! Inc. +License: Apache-2.0 + +License: Apache-2.0 + Licensed 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. + . + On Debian systems, the full text of the e Apache License, Version 2.0 + can be found in the file `/usr/share/common-licenses/Apache-2.0'. + + +Files: lib/ts/ink_rand.* +Copyright: 1997 - 2002, Makoto Matsumoto and Takuji Nishimura +License: + Mersenne Twister definitions adapted for Traffic Server + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + . + Any feedback is very welcome. + http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) + + +Files: lib/ts/ink_resolver.h ink_res_init.cc ink_res_mkquery.cc +Copyright: 1983, 1987, 1989 The Regents of the University of California +License: + For the University of California part: + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + . + For the Internet Systems Consortium, Inc. part: + See Apache-2.0 + . + For the Digital Equipment Corporation part: + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies, and that + the name of Digital Equipment Corporation not be used in advertising or + publicity pertaining to distribution of the document or software without + specific, written prior permission. + . + THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + + +Files: inktomi++/ink_string.cc: +Comment: For the strlcat, strlcpy in inktomi++/ink_string.cc +Copyright: 1998 Todd C. Miller +License: + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: lib/ts/fastlz.* +Copyright: 2005-2007 Ariya Hidayat (ariya@kde.org) +License: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + +Files: mgmt/cli/hashtable.* +Comment: Parts of mgmt/cli/hashtable.* only +Copyright: Copyright (c) 1997-1998 Sun Microsystems, Inc. +License: + This software is copyrighted by the Regents of the University of + California, Sun Microsystems, Inc., and other parties. The following + terms apply to all files associated with the software unless explicitly + disclaimed in individual files. + . + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + . + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + MODIFICATIONS. + . + GOVERNMENT USE: If you are acquiring this software on behalf of the + U.S. government, the Government shall have only "Restricted Rights" + in the software and related documentation as defined in the Federal + Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you + are acquiring the software on behalf of the Department of Defense, the + software shall be classified as "Commercial Computer Software" and the + Government shall have only "Restricted Rights" as defined in Clause + 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the + authors grant the U.S. Government and others acting in its behalf + permission to use and distribute the software in accordance with the + terms specified in this license. diff --git a/docs b/docs new file mode 100644 index 00000000..356cb60e --- /dev/null +++ b/docs @@ -0,0 +1,9 @@ +LAYOUT +NOTICE +STATUS +REVIEWERS +README +README-EC2 +debian/README.Debian +debian/CONFIGURATION.Debian +debian/README.conf-remap.Debian diff --git a/gbp.conf b/gbp.conf new file mode 100644 index 00000000..3e517ec6 --- /dev/null +++ b/gbp.conf @@ -0,0 +1,9 @@ +[DEFAULT] +pristine-tar = True +builder=dpkg-buildpackage -i\.git -I.git +#cleaner=true + +[git-import-orig] +filter = .gitignore +filter = .git +merge = True diff --git a/patches/series b/patches/series new file mode 100644 index 00000000..e69de29b diff --git a/rules b/rules new file mode 100755 index 00000000..41871c00 --- /dev/null +++ b/rules @@ -0,0 +1,51 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Get build architecture. ./configure is different on Linux +DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) + +configure_flags = \ + --enable-layout=Debian \ + --sysconfdir=/etc/trafficserver --libdir=/usr/lib/trafficserver \ + --libexecdir=/usr/lib/trafficserver/modules \ + --with-user=root --with-group=root --disable-silent-rules \ + --enable-experimental-plugins --enable-reclaimable-freelist\ + $(shell dpkg-buildflags --export=configure) + +ifeq ($(DEB_HOST_ARCH_OS),linux) + configure_flags += --enable-wccp --enable-linux-native-aio +endif + +%: + dh $@ --parallel --with autoreconf + +override_dh_auto_configure: + dh_auto_configure -- $(configure_flags) + +override_dh_auto_install: + dh_auto_install -- INSTALLDIRS=vendor + rm -f debian/tmp/usr/bin/trafficserver # We install our own + # Satisfy §10.2 (http://wiki.debian.org/ReleaseGoals/LAFileRemoval) + rm -f debian/tmp/usr/lib/trafficserver/lib*.la + rm -f debian/tmp/usr/lib/trafficserver/modules/*.la + rm -f debian/tmp/usr/lib/trafficserver/lib*.a + +override_dh_install: + dh_install --list-missing + ./debian/change_config.pl debian/trafficserver/etc/trafficserver/records.config + +override_dh_fixperms: + dh_fixperms -X etc/trafficserver -X var/lib/trafficserver \ + -X var/log/trafficserver -X /var/cache/trafficserver \ + -X var/run/trafficserver + +override_dh_installexamples: + dh_installexamples -X Makefile -X.deps -X.la -X.lo + +override_dh_makeshlibs: + dh_makeshlibs -X/usr/lib/trafficserver +override_dh_auto_test: + -dh_auto_test diff --git a/source/format b/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/source/options b/source/options new file mode 100644 index 00000000..9693b2ab --- /dev/null +++ b/source/options @@ -0,0 +1 @@ +--extend-diff-ignore='examples/|diags.log|lib/perl/' diff --git a/trafficserver-dev.examples b/trafficserver-dev.examples new file mode 100644 index 00000000..0bbe99ef --- /dev/null +++ b/trafficserver-dev.examples @@ -0,0 +1 @@ +example/* diff --git a/trafficserver-dev.install b/trafficserver-dev.install new file mode 100644 index 00000000..6404d743 --- /dev/null +++ b/trafficserver-dev.install @@ -0,0 +1,3 @@ +debian/tmp/usr/include/* +debian/tmp/usr/bin/tsxs +debian/tmp/usr/lib/trafficserver/lib*.so diff --git a/trafficserver-dev.manpages b/trafficserver-dev.manpages new file mode 100644 index 00000000..c1687793 --- /dev/null +++ b/trafficserver-dev.manpages @@ -0,0 +1,2 @@ +debian/tmp/usr/share/man/man1/tsxs.1 +debian/tmp/usr/share/man/man3/* diff --git a/trafficserver.default b/trafficserver.default new file mode 100644 index 00000000..d74b41eb --- /dev/null +++ b/trafficserver.default @@ -0,0 +1,64 @@ +## Defaults for trafficserver initscript +## sourced by /etc/init.d/trafficserver +## installed at /etc/default/trafficserver by the maintainer scripts + +## +## This is a POSIX shell fragment +## + +## Variable: RUNDIR +## Default: /var/run/trafficserver +## Description: Set this to the directory where runtime data is stored. The +## default value should work fine for almost all users. +# RUNDIR=/var/run/trafficserver + +## Variable: TC_START +## Default: no +## Description: Set to "yes" if you want the init script to start the +## `traffic_cop' binary. Usually this is what most users want +TC_START=yes + +## Variable: TC_DAEMON_ARGS +## Default: (empty) +## Description: Set here command line arguments the init script shall pass +## through `traffic_cop' upon startup. +# TC_DAEMON_ARGS="" + +## Variable: TC_PIDFILE +## Default: $RUNDIR/cop.lock +## Description: Set this to a (writable) path where the PID file of the +## `traffic_cop' script should be stored. Most likely you don't +## need to change this value. +# TC_PIDFILE=$RUNDIR/cop.lock + + +## +## NOTICE: +## Typically you do not want to configure anything below. Note, generally Traffic +## Server is started through `traffic_cop' which is a watchdog to control any local +## Traffic Server instances. It starts both, traffic_manager and traffic_server, as +## does it monitor these processes. While it is generally not advised, you can +## choose to manage both processes yourself. In such cases do not set TC_START to +## "yes" and enable any service you want below. +## +## Choose either alternative, but do not mix up both. + + +## Configuration for `traffic_manager'. +## Meaning of variables is analogous to traffic_cop above, but for the +## `traffic_manager' binary. + +# TM_START=no +# TM_DAEMON_ARGS="" +# TM_PIDFILE=$RUNDIR/manager.lock + + + +## Configuration for `traffic_server'. +## Meaning of variables is analogous to traffic_cop above, but for the +## `traffic_server' binary. + +# TS_START=no +# TS_DAEMON_ARGS="" +# TS_PIDFILE=$RUNDIR/server.lock + diff --git a/trafficserver.dirs b/trafficserver.dirs new file mode 100644 index 00000000..91e6eaf4 --- /dev/null +++ b/trafficserver.dirs @@ -0,0 +1,2 @@ +/var/cache/trafficserver +/var/log/trafficserver diff --git a/trafficserver.example b/trafficserver.example new file mode 100644 index 00000000..b9d32e1e --- /dev/null +++ b/trafficserver.example @@ -0,0 +1,2 @@ +plugins/experimental/cacheurl/*.example +plugins/experimental/mysql_remap/sample.ini diff --git a/trafficserver.init b/trafficserver.init new file mode 100644 index 00000000..ad344563 --- /dev/null +++ b/trafficserver.init @@ -0,0 +1,300 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: trafficserver +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: init script for the Apache Traffic Server +# Description: Apache Traffic Server is fast, scalable and extensible +# HTTP/1.1 compliant caching proxy server. +### END INIT INFO + +# Author: Arno Töll +# +# This init script is derived from the source package's version shipped +# along the source tarball as rc/trafficserver. Therefore it is a derivative +# work and licensed as follows: +# +# +# 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. + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Apache Traffic Server" +NAME=trafficserver +SCRIPTNAME=/etc/init.d/$NAME + + +# Please do not touch TS_ROOT and TS_BASE. Traffic Server uses them +# They are used to determine location of ATS components on the file +# system. +# According to DPM § 9.9 a program must not depend on the existance of +# environment variables to work properly. Please report any errors if +# you experience such a problem, for me it seems to work just fine with- +# out +ESED=/usr/bin/sed +test -x $ESED || ESED=sed +TS_PREFIX="/usr" +TS_ROOT=${TS_ROOT:-$TS_PREFIX} + +# TS_BASE is offset inside the file system from where the layout starts +# For standard installations TS_BASE will be empty +eval TS_BASE="`echo $TS_ROOT | ${ESED} -e 's;/usr$;;'`" + + +# Set some safe defaults. So not change values here, override them in +# in /etc/default/trafficserver instead. +# See there for a documentation as well + +RUNDIR=${RUNDIR:-$TS_BASE/var/run/trafficserver} + +TC_START=${TC_START:-no} +TC_NAME=${TC_NAME:-traffic_cop} +TC_DAEMON=${TC_DAEMON:-$TS_BASE/usr/bin/traffic_cop} +TC_DAEMON_ARGS="" +TC_PIDFILE=${TC_PIDFILE:-$RUNDIR/cop.lock} + + +TM_START=${TM_START:-no} +TM_NAME=${TM_NAME:-traffic_manager} +TM_DAEMON=${TM_DAEMON:-$TS_BASE/usr/bin/traffic_manager} +TM_DAEMON_ARGS="" +TM_PIDFILE=${TM_PIDFILE:-$RUNDIR/manager.lock} + +TS_START=${TS_START:-no} +TS_NAME=${TS_NAME:-traffic_server} +TS_DAEMON=${TS_DAEMON:-$TS_BASE/usr/bin/traffic_server} +TS_DAEMON_ARGS="" +TS_PIDFILE=${TS_PIDFILE:-$RUNDIR/server.lock} + + +# Exit if the package is not installed +[ -x "$TC_DAEMON" ] || exit 0 + + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +. /lib/lsb/init-functions + + +# Check permissions of /etc/trafficserver. +# Traffic Server needs write permissions, so warn the user if we suppose it +# wouldn't. +# The sysadmin is welcome to change the user ID that ATS uses. However to do that +# in a clean and supported way, the administrator should overwrite the `stat override' +# Debian installs by default in Trafficserver's postinst maintainer script. +# Print a warning only. +# Since this can't be safely determined by this script print a warning only, but +# don't fail. +CONF_DIR='/etc/trafficserver' +USER=$(dpkg-statoverride --list "$CONF_DIR" | awk '{print $1}') +OWNER=$(env stat -c '%U' "$CONF_DIR") +if [ -d "$CONF_DIR" ] && [ ! "x$OWNER" = "x$USER" ] ; then + log_warning_msg "Configuration directory '$CONF_DIR' is not owned by user '$USER'. " \ + "However Traffic Server needs write permissions to it." +fi + + +# Make sure $RUNDIR exists as the underlying file system +# may be volatile (see § 9.3.2 from DPM) +install -d -o trafficserver -g trafficserver -m 0755 "$RUNDIR" + + +# A helper function, its purpose is to start a daemon. +# Arguments are interpreted in order as follows: +# 1) The executable path +# 2) A string containing optional daemon arguments +# 3) A (valid) path containing the PID file for the daemon +# Returns: +# 0 if daemon has been started +# 1 if daemon was already running +# 2 if daemon could not be started +start_cmd() +{ + # Args + DAEMON=$1 + DAEMON_ARGS=$2 + PID=$3 + + #echo "\n\n" + #echo "d:" $DAEMON + #echo "da:" $DAEMON_ARGS + #echo "pid:" $PID + + start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --background --pidfile $PID --exec $DAEMON -- \ + $DAEMON_ARGS \ + || return 2 + + return 0 +} + + +# A helper function, its purpose is to stop a daemon. +# Arguments are interpreted in order as follows: +# 1) The daemon name (i.e. the binary name) +# 2) The executable path +# 3) A (valid) path containing the PID file for the daemon +# Returns: +# 0 if daemon has been stopped +# 1 if daemon was already stopped +# 2 if daemon could not be stopped +# Another value if a failure occurred +stop_cmd() +{ + NAME=$1 + DAEMON=$2 + PID=$3 + + #echo "\n\n" + #echo $NAME + #echo $DAEMON + #echo $PID + + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PID --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + + # Many daemons don't delete their pidfiles when they exit. + rm -f $PID + return "$RETVAL" +} + +# The start function +# This function does everything required to bring up the service +# at boot time. +# It does not accept any arguments +do_start() { + + if [ "x$TC_START" != "xno" ]; then + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $TC_NAME" + start_cmd "$TC_DAEMON" "$TC_DAEMON_ARGS" "$TC_PIDFILE" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + fi + + ## Starting TS and TM is usually not needed as TC takes care! + ## Please see /etc/default/trafficserver + + if [ "x$TM_START" != "xno" ]; then + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $TM_NAME" + start_cmd "$TM_DAEMON" "$TM_DAEMON_ARGS" "$TM_PIDFILE" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + fi + + + if [ "x$TS_START" != "xno" ]; then + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $TS_NAME" + start_cmd "$TS_DAEMON" "$TS_DAEMON_ARGS" "$TS_PIDFILE" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + + fi + + +} + + +# The stop function +# This function does everything required to stop the service. +# It does not accept any arguments +do_stop() { + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $TC_NAME" + stop_cmd "$TC_NAME" "$TC_DAEMON" "$TC_PIDFILE" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + + + + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $TM_NAME" + stop_cmd "$TM_NAME" "$TM_DAEMON" "$TM_PIDFILE" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + + + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $TS_NAME" + stop_cmd "$TS_NAME" "$TS_DAEMON" "$TS_PIDFILE" + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac +} + +case "$1" in + start) + if [ "x$TC_START" = "xno" ] && [ "x$TM_START" = "xno" ] && [ "x$TS_START" = "xno" ]; then + [ "$VERBOSE" != no ] && log_warning_msg "Not starting $DESC" + else + do_start + fi + ;; + stop) + do_stop + ;; + status) + if [ "x$TC_START" != "xno" ] ; then + status_of_proc "$TC_DAEMON" "$TC_NAME" -p "$TC_PIDFILE" && exit 0 || exit $? + else + status_of_proc "$TS_DAEMON" "$TS_NAME" -p "$TS_PIDFILE" || exit $? + status_of_proc "$TM_DAEMON" "$TM_NAME" -p "$TM_PIDFILE" || exit $? + fi + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME\n" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/trafficserver.install b/trafficserver.install new file mode 100644 index 00000000..bf3d0724 --- /dev/null +++ b/trafficserver.install @@ -0,0 +1,7 @@ +usr/bin/traffic_* +usr/bin/tspush +etc/trafficserver/* +usr/lib/trafficserver/lib*.so.* +usr/lib/trafficserver/modules/* +usr/share/doc/trafficserver/trafficshell/* +usr/share/perl5/* diff --git a/trafficserver.manpages b/trafficserver.manpages new file mode 100644 index 00000000..f6bf6bd0 --- /dev/null +++ b/trafficserver.manpages @@ -0,0 +1,4 @@ +debian/tmp/usr/share/man/man1/traffic_top.1 +debian/tmp/usr/share/man/man1/tspush.1 +debian/tmp/usr/share/man/man8/traffic_* +debian/tmp/usr/share/man/man5/* diff --git a/trafficserver.postinst b/trafficserver.postinst new file mode 100755 index 00000000..cb1c8d83 --- /dev/null +++ b/trafficserver.postinst @@ -0,0 +1,132 @@ +#! /bin/sh +# postinst script for trafficserver +# +# see: dh_installdeb(1) +# +# Copyright 2011 Arno Toell +# +# Licensed 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. + + +set -e + +USER='trafficserver' +GROUP='trafficserver' +USER_HOME='/var/run/trafficserver' +OWNER=$(env stat -c '%U' /etc/trafficserver) +OWNER_CACHE_DIR=$(env stat -c '%U' /var/cache/trafficserver) + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in +configure) + + if ! getent passwd -- "$USER" >/dev/null 2>&1 ; then + adduser --home "$USER_HOME" \ + --group \ + --system \ + --disabled-password \ + --no-create-home \ + --gecos "Debian Traffic Server user" \ + $USER + fi + + if [ -d /etc/trafficserver ] && [ "x$OWNER" = "xroot" ] ; then + # Ok, I admit I am lazy. I don't check every permission + # the user may have changed. If he didn't for /etc I can + # safely assume he neither has for other directories (I + # hope, since /etc requires write permissions by ATS). + echo 'Fixing permissions ...' + + if ! dpkg-statoverride --list /etc/trafficserver >/dev/null 2>&1; then + dpkg-statoverride --update --add "$USER" "$GROUP" 0755 /etc/trafficserver + fi + + if ! dpkg-statoverride --list /var/log/trafficserver >/dev/null 2>&1; then + dpkg-statoverride --update --add "$USER" adm 0750 /var/log/trafficserver + fi + + + find /etc/trafficserver -not -user "$USER" -exec \ + chown -h $USER:$GROUP {} \; + + + if [ -d /var/cache/trafficserver ] && [ "x$OWNER_CACHE_DIR" = "xroot" ] ; then + if ! dpkg-statoverride --list /var/cache/trafficserver >/dev/null 2>&1; then + dpkg-statoverride --update --add "$USER" adm 0750 /var/cache/trafficserver + fi + fi + fi + + if [ -n "$2" ] && dpkg --compare-versions "$2" 'le' '3.2~' ; then + RET=0 + invoke-rc.d trafficserver status > /dev/null 2>&1 || RET=$? + # 0 => ATS is running + # 4 => Status is unknown + # 1,2,3 => ATS is not running + + # using /bin/echo to make sure -e is supported + ECHO=`which echo` + if [ "$RET" -gt 0 ] && [ "$RET" -ne 4 ] && [ -f /var/cache/trafficserver/host.db ] ; then + echo "Purging TrafficServer cache upon upgrade." + RET=0 + traffic_server -Cclear > /dev/null 2>&1 || RET=$? + if [ "$RET" -ne 0 ] ; then + $ECHO "=======================================================================" + $ECHO -e "WARNING: Apache TrafficServer's cache couldn't be purged during the upgrade.\n" \ + "Please inspect the situation manually and call 'traffic_server -Cclear'\n" \ + "afterwards to purge the caches." + $ECHO "=======================================================================" + fi + else + $ECHO "=======================================================================" + $ECHO -e "WARNING: Apache TrafficServer is not running or its state couldn't be\n" \ + "determined. Please inspect the situation manually and call\n" \ + "'traffic_server -Cclear' afterwards to purge the caches.\n" + $ECHO "=======================================================================" + + fi + fi +;; + +abort-upgrade|abort-remove|abort-deconfigure) + +;; + +*) +echo "postinst called with unknown argument \`$1'" >&2 +exit 0 +;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/watch b/watch new file mode 100644 index 00000000..bcceff9c --- /dev/null +++ b/watch @@ -0,0 +1,2 @@ +version=3 +http://www.apache.org/dist//trafficserver/trafficserver-(\d+\.\d+.\d+)\.tar\.bz2 debian uupdate