--- memcached-1.4.2.orig/debian/changelog +++ memcached-1.4.2/debian/changelog @@ -0,0 +1,233 @@ +memcached (1.4.2-1ubuntu3~karmic1) karmic-backports; urgency=low + + * Automated backport upload; no source changes. + + -- dormando Wed, 09 Jun 2010 00:36:26 +0100 + +memcached (1.4.2-1ubuntu3) lucid; urgency=low + + * added debian/patches/fix-ubuntu-ftbfs.patch + to fix (LP: #565152) + + -- Matt Wheeler Sat, 17 Apr 2010 03:20:19 +0100 + +memcached (1.4.2-1ubuntu2) lucid; urgency=low + + * debian/patches/fix-issue-102-segfault.patch: Update patch with a more + propper fix. (LP: #558328) + + -- Chuck Short Thu, 15 Apr 2010 08:34:42 -0400 + +memcached (1.4.2-1ubuntu1) lucid; urgency=low + + * debian/patches/fix-issue-102-segfault.patch: Fix segfault when client is + sending bad data (LP: #558328) + + -- Chuck Short Thu, 08 Apr 2010 11:01:23 -0400 + +memcached (1.4.2-1) unstable; urgency=medium + + * New upstream release, primarily bugfixes, some of them critical, hence + the urgency: + - Reject keys larger than 250 bytes in the binary protocol. + - Bounds checking on stats cachedump. + - Binary protocol set+cas wasn't returning a new cas ID. + - Binary quitq didn't actually close the connection + - Slab boundary checking cleanup (bad logic in unreachable code) + - Get hit memory optimizations + - Disallow -t options that cause the server to not work + - Killed off incomplete slab rebalance feature. + * debian/patches: + - 01_init_script_compliant_with_LSB.patch: Remade as upstream applied a + whitespace cleanup script that broke the patch. + - 02_manpage_additions.patch: Added missing parameters to the memcached + manpage. + * Removed TODO from debian/docs. + + -- David Martínez Moreno Fri, 16 Oct 2009 15:09:43 +0200 + +memcached (1.4.1-1) unstable; urgency=high + + * New upstream release (closes: #545883): + - Finally addressed CVE-2009-2415: heap-based buffer overflow in length + processing (closes: #540379). + - Boundary condition during pipelined decoding caused crash. + - Bad initialization during buffer realloc. + - Buffer overrun in stats_prefix_find. + - Other fixes and cleanups. + * Changed the default start to yes in /etc/init.d/memcached as well. + * debian/watch updated with new format and URL in code.google.com. Thanks, + Monty Taylor. + * Added get-orig-source target, thanks to Monty Taylor. + * debian/control: + - Upgraded Standards-Version to 3.8.3 (no changes). + - Added Suggests: libmemcached. + - Bumped debhelper dependency and debian/compat to 6. + - Added Depends on quilt 0.46-7 in order to use dh_quilt_* helpers. + * debian/rules: Added dh_quilt_* helpers. + * Added direct patches to source as quilt patches. + * debian/README.source: Created such file to shut up lintian pedantic. + + -- David Martínez Moreno Fri, 18 Sep 2009 02:43:54 +0200 + +memcached (1.4.0-1) unstable; urgency=low + + * New upstream release (closes: #484301, #537239): + - New binary protocol, supporting CAS (compare-and-swap). + - Non-threaded version is no longer possible, you just choose to run 1 + thread to have similar behaviour. + - Lots of performance bottlenecks fixed (connection starvation, + contention, disabling of CAS, locks for hash table expansion...). + - Lots of new stats. Main change is that stats now are per-slab where + possible. + - Code cleanup, lots of bugs fixed, added tests, enhanced documentation. + + -- David Martínez Moreno Sat, 01 Aug 2009 23:26:45 +0200 + +memcached (1.2.8-2) unstable; urgency=low + + * After some thinking, probably making memcached starting by default is the + right thing to do (closes: #536524). + * Added status support to init.d script (closes: #528689). Thanks, Peter! + * debian/control: Added dependency on lsb-base (>= 3.2-13). + + -- David Martínez Moreno Sat, 11 Jul 2009 00:29:51 +0200 + +memcached (1.2.8-1) unstable; urgency=high + + * New upstream release, urgency=high because of two critical bugs prior + to this release: + - In 1.2.7 under multithreaded mode, memcached would never restart + accepting connections after hitting the maximum connection limit. + - Remove 'stats maps' command, as it is a potential information leak, + usable if versions prior to 1.2.8 ever have buffer overflows discovered + (CVE-2009-1494). Closes: #526554. + - Make -b command (setting the TCP listen backlog) actually work. + * debian/rules: Removed obsolete --disable-static. + + -- David Martínez Moreno Sat, 02 May 2009 19:15:49 +0200 + +memcached (1.2.7-1) unstable; urgency=low + + * New upstream release, released on 4/3/2009. + - New statistics. + - Added -R option. Limit the number of requests processed by a connection + at once. Prevents starving other threads if bulk loading. + - Added -b command for setting the tcp listen backlog. + - Many minor bugfixes. + + -- David Martínez Moreno Sat, 02 May 2009 18:13:39 +0200 + +memcached (1.2.6-1) unstable; urgency=low + + * New upstream release (closes: #505037). Released on 29/7/2008. + - Major crash fixes. + - DTrace support. + - Minor updates. + * debian/memcached.postrm: Now /var/log/memcached.log is removed on purge. + Thanks, jidanni! (closes: #447288). + + -- David Martínez Moreno Sat, 28 Feb 2009 09:43:24 +0000 + +memcached (1.2.5-1) unstable; urgency=low + + * New upstream release, released on 3/2/2008: + - Minor bugfixes. + - Added support for Opensolaris. + - IPv6 support. + - "noreply" mode for many commands. + - Made "out of memory· errors more clear. + - Added eviction/OOM tracking per slab class. + + -- David Martínez Moreno Fri, 27 Feb 2009 10:48:14 +0000 + +memcached (1.2.4-1) unstable; urgency=low + + * New upstream release (closes: #454699). Released on 6/12/2007: + - Many bug and platform fixes since 1.2.2. + - New threading support for stat queries. + - New commands 'append', 'prepend', 'gets', and 'cas'. + - Updates to the manpage (closes: #441067). + - Now memcached has a flag -a to restrict the socket to a group (closes: + #446606). + * debian/rules: Added memcached-tool to the set of installed scripts. + Thanks, Cyril! (closes: #512400). + + -- David Martínez Moreno Thu, 26 Feb 2009 12:07:03 +0000 + +memcached (1.2.3-1) unstable; urgency=low + + * Take over memcached package. + * New upstream release. Mostly a documentation and warning fixing release. + This one was released on 6/7/2007. + * Added an /etc/default/memcached, thanks to Mark Ferlatte (closes: + #467356). + * debian/rules: Added --enable-threads to configure. It's amazing how this + could be missing from mainstream packages in Debian. + * debian/control: + - Put myself as Maintainer. + - Added Homepage field. + - Bumped Standards-Version to 3.8.0. + - Added ${misc:Depends} to Depends line. + * debian/copyright: Added a lot of information. + * debian/memcached.post{inst,rm}: Added set -e in order to catch errors. + + -- David Martínez Moreno Thu, 26 Feb 2009 09:51:46 +0000 + +memcached (1.2.2-1) unstable; urgency=low + + * New upstream release + + -- Jay Bonci Fri, 29 Jun 2007 10:18:03 -0400 + +memcached (1.2.1-1) unstable; urgency=low + + * New upstream release (Closes: #405054) + * Fix to logfile output so logrotate will work (Closes: #417941) + * Listen in on localhost by default (Closes: #383660) + * Default configuration suggests nobody by default (Closes: #391351) + * Bumped policy version to 3.7.2.2 (No other changes) + + -- Jay Bonci Wed, 02 May 2007 11:35:42 -0400 + +memcached (1.1.12-1) unstable; urgency=low + + * New upstream version + * Updates watchfile so uupdate will work + + -- Jay Bonci Mon, 11 Apr 2005 11:54:39 -0400 + +memcached (1.1.11-3) unstable; urgency=low + + * Rebuild against non-broken libevent + + -- Jay Bonci Fri, 18 Feb 2005 09:11:55 -0500 + +memcached (1.1.11-2) unstable; urgency=low + + * Adds debian/watch file so uscan will work + * Added additional paragraph to debian/control (Closes: #262069) + + -- Jay Bonci Wed, 27 Oct 2004 13:49:22 -0400 + +memcached (1.1.11-1) unstable; urgency=low + + * New upstream version + * Fix silly typo that kept daemon from running as www-data (Closes: #239854) + - Thanks to Karaszi Istvan for the report + * Fix to reopen fds as the logfile, adds logfile support (Closes: #243522) + + -- Jay Bonci Wed, 5 May 2004 17:25:25 -0400 + +memcached (1.1.10-1) unstable; urgency=low + + * New upstream version + + -- Jay Bonci Wed, 31 Dec 2003 10:01:27 -0500 + +memcached (1.1.9-1) unstable; urgency=low + + * Initial Release (Closes: #206268). + + -- Jay Bonci Wed, 15 Oct 2003 15:53:51 -0400 + --- memcached-1.4.2.orig/debian/memcached.manpages +++ memcached-1.4.2/debian/memcached.manpages @@ -0,0 +1 @@ +doc/memcached.1 --- memcached-1.4.2.orig/debian/copyright +++ memcached-1.4.2/debian/copyright @@ -0,0 +1,58 @@ +This package was debianized by Jay Bonci on +Wed, 15 Oct 2003 15:53:51 -0400. + +It was downloaded from http://www.danga.com/memcached + +Upstream authors: Brad Fitzpatrick and Danga Interactive + +Copyright: + +memcached is (C) Danga Interactive 2003-2007 + +This product includes software developed by Niels Provos (libevent). + +libevent is copyright 2000-2003 Niels Provos +All rights reserved. + +autotools code is Copyright (C) 1992-2007 Free Software Foundation, Inc. + + +License: + +The memcached server is licensed under the BSD-style license. The full text of +that license may be found on a Debian GNU/Linux system in: + +/usr/share/common-licenses/BSD + +autotools code is licensed under GNU Public License. You may find a copy of this +license in a Debian GNU/Linux system in: + +/usr/share/common-licenses/GPL + + +For libevent: + +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. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Niels Provos. +4. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. --- memcached-1.4.2.orig/debian/compat +++ memcached-1.4.2/debian/compat @@ -0,0 +1 @@ +6 --- memcached-1.4.2.orig/debian/memcached.dirs +++ memcached-1.4.2/debian/memcached.dirs @@ -0,0 +1,4 @@ +etc/ +usr/share/doc/memcached +usr/share/memcached/scripts +usr/bin --- memcached-1.4.2.orig/debian/docs +++ memcached-1.4.2/debian/docs @@ -0,0 +1,4 @@ +NEWS +README +doc/memory_management.txt +doc/protocol.txt --- memcached-1.4.2.orig/debian/memcached.default +++ memcached-1.4.2/debian/memcached.default @@ -0,0 +1,2 @@ +# Set this to no to disable memcached. +ENABLE_MEMCACHED=yes --- memcached-1.4.2.orig/debian/README.Debian +++ memcached-1.4.2/debian/README.Debian @@ -0,0 +1,14 @@ +Memcached has two logical uses in this package, a system daemon that can be run +from the standard /etc/init.d/ interface, or one that can be run from userland +from a the command line such as + /usr/bin/memcached -d + +The former has been setup to run through the start-memcached script, reading in +the configuration from /etc/memcached.conf. The start-memcached script ignores +certain parameters as discussed in the configuration file itself. + +The latter is the binary as provided by Danga, and reads in options from the +command line, ignoring the Debian-specific configuration file entirely. + + --Jay Bonci + jaybonci@debian.org --- memcached-1.4.2.orig/debian/watch +++ memcached-1.4.2/debian/watch @@ -0,0 +1,6 @@ +# format version number, currently 3; this line is compulsory! +version=3 + +# code.google.com/p/$project/downloads/list has links to $project.googlecode.com/files/ +opts="versionmangle=s/beta/~b/" http://code.google.com/p/memcached/downloads/list \ + http://memcached.googlecode.com/files/memcached-(.*)\.tar\.gz --- memcached-1.4.2.orig/debian/rules +++ memcached-1.4.2/debian/rules @@ -0,0 +1,104 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +PACKAGE=memcached +PKGBASE=debian/$(PACKAGE)/usr/share/memcached/ +SCRIPTS=$(PKGBASE)/scripts + +CFLAGS=-Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS +=-O0 +else + CFLAGS +=-O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +get-orig-source: + uscan --verbose --force-download --rename --repack --destdir=.. + +config.status: configure + dh_testdir + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info + +build: build-stamp + +build-stamp: config.status + dh_quilt_patch + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp config.log + rm -f debian/memcached.init + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + + dh_quilt_unpatch + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/memcached. + $(MAKE) install DESTDIR=$(CURDIR)/debian/memcached + #install -d $(CURDIR)/$(PKGBASE) + install -m 644 $(CURDIR)/debian/memcached.conf $(CURDIR)/$(PKGBASE)/memcached.conf.default + #install -d $(SCRIPTS) + install -m 744 $(CURDIR)/scripts/start-memcached $(SCRIPTS) + install -m 744 $(CURDIR)/scripts/memcached-tool $(SCRIPTS) + install -m 755 $(CURDIR)/scripts/memcached-init $(CURDIR)/debian/memcached.init + + +# Build architecture-independent files here. +binary-indep:; +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_install + dh_installdebconf + dh_installinit + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- memcached-1.4.2.orig/debian/memcached.conf +++ memcached-1.4.2/debian/memcached.conf @@ -0,0 +1,47 @@ +# memcached default config file +# 2003 - Jay Bonci +# This configuration file is read by the start-memcached script provided as +# part of the Debian GNU/Linux distribution. + +# Run memcached as a daemon. This command is implied, and is not needed for the +# daemon to run. See the README.Debian that comes with this package for more +# information. +-d + +# Log memcached's output to /var/log/memcached +logfile /var/log/memcached.log + +# Be verbose +# -v + +# Be even more verbose (print client commands as well) +# -vv + +# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default +# Note that the daemon will grow to this size, but does not start out holding this much +# memory +-m 64 + +# Default connection port is 11211 +-p 11211 + +# Run the daemon as root. The start-memcached will default to running as root if no +# -u command is present in this config file +-u nobody + +# Specify which IP address to listen on. The default is to listen on all IP addresses +# This parameter is one of the only security measures that memcached has, so make sure +# it's listening on a firewalled interface. +-l 127.0.0.1 + +# Limit the number of simultaneous incoming connections. The daemon default is 1024 +# -c 1024 + +# Lock down all paged memory. Consult with the README and homepage before you do this +# -k + +# Return error when memory is exhausted (rather than removing items) +# -M + +# Maximize core file limit +# -r --- memcached-1.4.2.orig/debian/README.source +++ memcached-1.4.2/debian/README.source @@ -0,0 +1,4 @@ +This package uses quilt for patch management. Refer to /usr/share/doc/quilt/README.source +from the package 'quilt' for more information about this system. + + -- David Martínez Moreno Fri, 18 Sep 2009 02:43:54 +0200 --- memcached-1.4.2.orig/debian/memcached.postrm +++ memcached-1.4.2/debian/memcached.postrm @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +if [ "$1" = "purge" ] + then + rm -f /etc/memcached.conf + rm -f /var/log/memcached.log +fi + + rm -f /var/run/memcached.pid + +#DEBHELPER# --- memcached-1.4.2.orig/debian/memcached.postinst +++ memcached-1.4.2/debian/memcached.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ ! -e /etc/memcached.conf ] + then + mkdir -p /etc + cp /usr/share/memcached/memcached.conf.default /etc/memcached.conf +fi + +#DEBHELPER# --- memcached-1.4.2.orig/debian/control +++ memcached-1.4.2/debian/control @@ -0,0 +1,27 @@ +Source: memcached +Section: web +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: David Martínez Moreno +Build-Depends: debhelper (>= 6), libevent-dev, quilt (>= 0.46-7) +Homepage: http://www.danga.com/memcached/ +Standards-Version: 3.8.3 + +Package: memcached +Architecture: any +Depends: ${shlibs:Depends}, perl, ${misc:Depends}, lsb-base (>= 3.2-13) +Suggests: libcache-memcached-perl, libmemcached +Description: A high-performance memory object caching system + Danga Interactive developed memcached to enhance the speed of LiveJournal.com, + a site which was already doing 20 million+ dynamic page views per day for 1 + million users with a bunch of webservers and a bunch of database servers. + memcached dropped the database load to almost nothing, yielding faster page + load times for users, better resource utilization, and faster access to the + databases on a memcache miss. + . + memcached optimizes specific high-load serving applications that are designed + to take advantage of its versatile no-locking memory access system. Clients + are available in several different programming languages, to suit the needs + of the specific application. Traditionally this has been used in mod_perl + apps to avoid storing large chunks of data in Apache memory, and to share + this burden across several machines. --- memcached-1.4.2.orig/debian/patches/fix-issue-102-segfault.patch +++ memcached-1.4.2/debian/patches/fix-issue-102-segfault.patch @@ -0,0 +1,97 @@ +diff -Naurp memcached-1.4.2.orig/memcached.c memcached-1.4.2/memcached.c +--- memcached-1.4.2.orig/memcached.c 2009-10-12 02:44:25.000000000 -0400 ++++ memcached-1.4.2/memcached.c 2010-04-15 08:33:59.404405275 -0400 +@@ -2908,9 +2908,28 @@ static int try_read_command(conn *c) { + + if (c->rbytes == 0) + return 0; ++ + el = memchr(c->rcurr, '\n', c->rbytes); +- if (!el) ++ if (!el) { ++ if (c->rbytes > 1024) { ++ /* ++ * We didn't have a '\n' in the first k. This _has_ to be a ++ * large multiget, if not we should just nuke the connection. ++ */ ++ char *ptr = c->rcurr; ++ while (*ptr == ' ') { /* ignore leading whitespaces */ ++ ++ptr; ++ } ++ ++ if (ptr - c->rcurr > 100 || ++ strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { ++ conn_set_state(c, conn_closing); ++ return 1; ++ } ++ } ++ + return 0; ++ } + cont = el + 1; + if ((el - c->rcurr) > 1 && *(el - 1) == '\r') { + el--; +@@ -2972,12 +2991,17 @@ static enum try_read_result try_read_udp + * close. + * before reading, move the remaining incomplete fragment of a command + * (if any) to the beginning of the buffer. ++ * ++ * To protect us from someone flooding a connection with bogus data causing ++ * the connection to eat up all available memory, break out and start looking ++ * at the data I've got after a number of reallocs... ++ * + * @return enum try_read_result + */ + static enum try_read_result try_read_network(conn *c) { + enum try_read_result gotdata = READ_NO_DATA_RECEIVED; + int res; +- ++ int num_allocs = 0; + assert(c != NULL); + + if (c->rcurr != c->rbuf) { +@@ -2988,6 +3012,10 @@ static enum try_read_result try_read_net + + while (1) { + if (c->rbytes >= c->rsize) { ++ if (num_allocs == 4) { ++ return gotdata; ++ } ++ ++num_allocs; + char *new_rbuf = realloc(c->rbuf, c->rsize * 2); + if (!new_rbuf) { + if (settings.verbose > 0) +diff -Naurp memcached-1.4.2.orig/testapp.c memcached-1.4.2/testapp.c +--- memcached-1.4.2.orig/testapp.c 2009-10-12 02:44:25.000000000 -0400 ++++ memcached-1.4.2/testapp.c 2010-04-15 08:31:34.864405417 -0400 +@@ -529,6 +529,22 @@ static enum test_return test_issue_92(vo + return TEST_PASS; + } + ++static enum test_return test_issue_102(void) { ++ char buffer[4096]; ++ memset(buffer, ' ', sizeof(buffer)); ++ buffer[sizeof(buffer) - 1] = '\0'; ++ ++ close(sock); ++ sock = connect_server("127.0.0.1", port); ++ ++ send_ascii_command(buffer); ++ /* verify that the server closed the connection */ ++ assert(read(sock, buffer, sizeof(buffer)) == 0); ++ close(sock); ++ sock = connect_server("127.0.0.1", port); ++ return TEST_PASS; ++} ++ + static enum test_return start_memcached_server(void) { + server_pid = start_server(&port, false, 600); + sock = connect_server("127.0.0.1", port); +@@ -1663,6 +1679,7 @@ struct testcase testcases[] = { + /* The following tests all run towards the same server */ + { "start_server", start_memcached_server }, + { "issue_92", test_issue_92 }, ++ { "issue_102", test_issue_102 }, + { "binary_noop", test_binary_noop }, + { "binary_quit", test_binary_quit }, + { "binary_quitq", test_binary_quitq }, --- memcached-1.4.2.orig/debian/patches/01_init_script_compliant_with_LSB.patch +++ memcached-1.4.2/debian/patches/01_init_script_compliant_with_LSB.patch @@ -0,0 +1,113 @@ +Index: memcached-1.4.2/scripts/memcached-init +=================================================================== +--- memcached-1.4.2.orig/scripts/memcached-init ++++ memcached-1.4.2/scripts/memcached-init +@@ -1,14 +1,16 @@ + #! /bin/sh +-# +-# skeleton example file to build /etc/init.d/ scripts. +-# This file should be used to construct scripts for /etc/init.d. +-# +-# Written by Miquel van Smoorenburg . +-# Modified for Debian +-# by Ian Murdock . +-# +-# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl +-# ++### BEGIN INIT INFO ++# Provides: memcached ++# Required-Start: $syslog ++# Required-Stop: $syslog ++# Should-Start: $local_fs ++# Should-Stop: $local_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: memcached - Memory caching daemon ++# Description: memcached - Memory caching daemon ++### END INIT INFO ++ + + PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + DAEMON=/usr/bin/memcached +@@ -22,38 +24,50 @@ test -x $DAEMONBOOTSTRAP || exit 0 + + set -e + ++. /lib/lsb/init-functions ++ ++# Edit /etc/default/memcached to change this. ++ENABLE_MEMCACHED=no ++test -r /etc/default/memcached && . /etc/default/memcached ++ + case "$1" in +- start) +- echo -n "Starting $DESC: " +- start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP +- echo "$NAME." +- ;; +- stop) +- echo -n "Stopping $DESC: " +- start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON +- echo "$NAME." +- rm -f $PIDFILE +- ;; +- +- restart|force-reload) +- # +- # If the "reload" option is implemented, move the "force-reload" +- # option to the "reload" entry above. If not, "force-reload" is +- # just the same as "restart". +- # +- echo -n "Restarting $DESC: " +- start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE +- rm -f $PIDFILE +- sleep 1 +- start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP +- echo "$NAME." +- ;; +- *) +- N=/etc/init.d/$NAME +- # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 +- echo "Usage: $N {start|stop|restart|force-reload}" >&2 +- exit 1 +- ;; ++ start) ++ echo -n "Starting $DESC: " ++ if [ $ENABLE_MEMCACHED = yes ]; then ++ start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP ++ echo "$NAME." ++ else ++ echo "$NAME disabled in /etc/default/memcached." ++ fi ++ ;; ++ stop) ++ echo -n "Stopping $DESC: " ++ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON ++ echo "$NAME." ++ rm -f $PIDFILE ++ ;; ++ ++ restart|force-reload) ++ # ++ # If the "reload" option is implemented, move the "force-reload" ++ # option to the "reload" entry above. If not, "force-reload" is ++ # just the same as "restart". ++ # ++ echo -n "Restarting $DESC: " ++ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE ++ rm -f $PIDFILE ++ sleep 1 ++ start-stop-daemon --start --quiet --exec $DAEMONBOOTSTRAP ++ echo "$NAME." ++ ;; ++ status) ++ status_of_proc $DAEMON $NAME ++ ;; ++ *) ++ N=/etc/init.d/$NAME ++ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 ++ exit 1 ++ ;; + esac + + exit 0 --- memcached-1.4.2.orig/debian/patches/series +++ memcached-1.4.2/debian/patches/series @@ -0,0 +1,4 @@ +01_init_script_compliant_with_LSB.patch +02_manpage_additions.patch +fix-issue-102-segfault.patch +fix-ubuntu-ftbfs.patch --- memcached-1.4.2.orig/debian/patches/fix-ubuntu-ftbfs.patch +++ memcached-1.4.2/debian/patches/fix-ubuntu-ftbfs.patch @@ -0,0 +1,13 @@ +Index: memcached-1.4.2/memcached.c +=================================================================== +--- memcached-1.4.2.orig/memcached.c 2010-04-17 03:27:20.155037988 +0100 ++++ memcached-1.4.2/memcached.c 2010-04-17 03:28:00.506769722 +0100 +@@ -2922,7 +2922,7 @@ + } + + if (ptr - c->rcurr > 100 || +- strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { ++ (strcmp(ptr, "get ") && strcmp(ptr, "gets "))) { + conn_set_state(c, conn_closing); + return 1; + } --- memcached-1.4.2.orig/debian/patches/02_manpage_additions.patch +++ memcached-1.4.2/debian/patches/02_manpage_additions.patch @@ -0,0 +1,58 @@ +Index: memcached-1.4.2/doc/memcached.1 +=================================================================== +--- memcached-1.4.2.orig/doc/memcached.1 ++++ memcached-1.4.2/doc/memcached.1 +@@ -1,4 +1,4 @@ +-.TH MEMCACHED 1 "April 11, 2005" ++.TH MEMCACHED 1 "October 16, 2009" + .SH NAME + memcached \- high-performance memory object caching system + .SH SYNOPSIS +@@ -95,29 +95,39 @@ Be verbose during the event loop; print + Be even more verbose; same as \-v but also print client commands and + responses. + .TP ++.B \-vvv ++Be extremely verbose; same of the above and also print internal state transitions. ++.TP + .B \-i + Print memcached and libevent licenses. + .TP ++.B \-I ++Override the size of each slab page in bytes. In mundane words, it adjusts the ++maximum item size that memcached will accept. You can use the suffixes \fBK\fR and ++\fBM\fR to specify the size as well, so use 2000000 or 2000K or 2M if you want a ++maximum size of 2 MB per object. It is not recommended to raise this limit above ++1 MB due just to performance reasons. The default value is 1 MB. ++.TP + .B \-P + Print pidfile to , only used under \-d option. + .TP + .B \-t +-Number of threads to use to process incoming requests. This option is only +-meaningful if memcached was compiled with thread support enabled. It is ++Number of threads to use to process incoming requests. It is + typically not useful to set this higher than the number of CPU cores on the +-memcached server. The default is 4. ++memcached server. Setting a high number (64 or more) of worker ++threads is not recommended. The default is 4. + .TP + .B \-D +-Use as the delimiter between key prefixes and IDs. This is used for +-per-prefix stats reporting. The default is ":" (colon). If this option is ++Use as the delimiter between key prefixes and IDs. This is used for ++per-prefix stats reporting. The default is ":" (colon). If this option is + specified, stats collection is turned on automatically; if not, then it may + be turned on by sending the "stats detail on" command to the server. + .TP + .B \-L +-Try to use large memory pages (if available). Increasing the memory page size +-could reduce the number of TLB misses and improve the performance. In order to ++Try to use large memory pages (if available). Increasing the memory page size ++could reduce the number of TLB misses and improve the performance. In order to + get large pages from the OS, memcached will allocate the total item-cache in +-one large chunk. Only available if supported on your OS. ++one large chunk. Only available if supported on your OS. + .TP + .B \-B + Specify the binding protocol to use. By default, the server will