--- memcached-1.4.5.orig/debian/memcached.postrm +++ memcached-1.4.5/debian/memcached.postrm @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +USER=memcache +GROUP=memcache + +if [ "$1" = "purge" ] + then + rm -f /etc/memcached.conf + rm -f /var/log/memcached.log + + deluser --system $USER || true + delgroup --system --only-if-empty $GROUP || true +fi + + rm -f /var/run/memcached.pid + +#DEBHELPER# --- memcached-1.4.5.orig/debian/memcached.manpages +++ memcached-1.4.5/debian/memcached.manpages @@ -0,0 +1 @@ +doc/memcached.1 --- memcached-1.4.5.orig/debian/copyright +++ memcached-1.4.5/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.5.orig/debian/compat +++ memcached-1.4.5/debian/compat @@ -0,0 +1 @@ +6 --- memcached-1.4.5.orig/debian/changelog +++ memcached-1.4.5/debian/changelog @@ -0,0 +1,246 @@ +memcached (1.4.5-1ubuntu2) natty; urgency=low + + * Cherry-pick patch from upstream to fix FTBFS with gcc 4.5 (LP: #687984) + - Add 03_fix_ftbfs_gcc_45.patch + + -- Felix Geyer Fri, 10 Dec 2010 16:23:30 +0100 + +memcached (1.4.5-1ubuntu1) maverick; urgency=low + + * Run as 'memcache' user instead of nobody (LP: #599461) + * depend on adduser for preinst/postrm + * create user in postinst + + -- Clint Byrum Tue, 29 Jun 2010 06:37:17 -0700 + +memcached (1.4.5-1) unstable; urgency=high + + * New upstream release. Main changes since 1.4.2 are: + New features: + - Support for SASL authentication. + - New script damemtop - a memcached top. + - Slab optimizations. + - New stats, for reclaimed memory and SASL events. + Bugs fixed: + - Malicious input can crash server (CVE-2010-1152). Closes: #579913. + - Fixed several problems with slab handling and growth. + - Provide better error reporting. + - Fix get stats accounting. + - Fixed backwards compatibility with delete 0. + - Documentation fixes. + - Various build fixes, among others, fixed FTBFS with gcc-4.5 (closes: + #565033). + * Refreshed and renamed 01_init_script_compliant_with_LSB.patch. + * Fixed lintian warnings by adding $remote_fs to init.d script. + * Removed non-existent document (doc/memory_management.txt). + * debian/control: Bumped Standards-Version to 3.8.4 (no changes). + * + + -- David Martínez Moreno Wed, 12 May 2010 11:41:22 +0200 + +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.5.orig/debian/memcached.default +++ memcached-1.4.5/debian/memcached.default @@ -0,0 +1,2 @@ +# Set this to no to disable memcached. +ENABLE_MEMCACHED=yes --- memcached-1.4.5.orig/debian/docs +++ memcached-1.4.5/debian/docs @@ -0,0 +1,3 @@ +NEWS +README +doc/protocol.txt --- memcached-1.4.5.orig/debian/README.Debian +++ memcached-1.4.5/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.5.orig/debian/rules +++ memcached-1.4.5/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.5.orig/debian/README.source +++ memcached-1.4.5/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.5.orig/debian/memcached.postinst +++ memcached-1.4.5/debian/memcached.postinst @@ -0,0 +1,39 @@ +#!/bin/sh + +set -e + +GROUP="memcache" +USER="memcache" +DATADIR="/nonexistent" + +# shamelessly copied from debian gearman-job-server package... + +case "$1" in +configure) + # creating memcache group if it isn't already there + if ! getent group $GROUP >/dev/null ; then + # Adding system group + addgroup --system $GROUP >/dev/null + fi + + # creating memcache user if it isn't already there + if ! getent passwd $USER >/dev/null ; then + # Adding system user + adduser \ + --system \ + --disabled-login \ + --ingroup $GROUP \ + --home $DATADIR \ + --gecos "Memcached" \ + --shell /bin/false \ + $USER >/dev/null + fi + if [ ! -e /etc/memcached.conf ] + then + mkdir -p /etc + cp /usr/share/memcached/memcached.conf.default /etc/memcached.conf + fi + ;; +esac + +#DEBHELPER# --- memcached-1.4.5.orig/debian/control +++ memcached-1.4.5/debian/control @@ -0,0 +1,28 @@ +Source: memcached +Section: web +Priority: optional +Maintainer: Ubuntu 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.4 + +Package: memcached +Architecture: any +Depends: ${shlibs:Depends}, perl, ${misc:Depends}, lsb-base (>= 3.2-13) + , adduser +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.5.orig/debian/memcached.dirs +++ memcached-1.4.5/debian/memcached.dirs @@ -0,0 +1,4 @@ +etc/ +usr/share/doc/memcached +usr/share/memcached/scripts +usr/bin --- memcached-1.4.5.orig/debian/memcached.conf +++ memcached-1.4.5/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 memcache + +# 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.5.orig/debian/watch +++ memcached-1.4.5/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.5.orig/debian/patches/01_init_script_additions.patch +++ memcached-1.4.5/debian/patches/01_init_script_additions.patch @@ -0,0 +1,118 @@ +Index: memcached-1.4.5/scripts/memcached-init +=================================================================== +--- memcached-1.4.5.orig/scripts/memcached-init ++++ memcached-1.4.5/scripts/memcached-init +@@ -1,22 +1,14 @@ + #! /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 +-# Default-Start: 2 3 4 5 +-# Default-Stop: 0 1 6 +-# Short-Description: Start memcached daemon at boot time +-# Description: Enable memcached server ++# Provides: memcached ++# Required-Start: $remote_fs $syslog ++# Required-Stop: $remote_fs $syslog ++# Should-Start: $local_fs ++# Should-Stop: $local_fs ++# Default-Start: 2 3 4 5 ++# Default-Stop: 0 1 6 ++# Short-Description: Start memcached daemon ++# Description: Start up memcached, a high-performance memory caching daemon + ### END INIT INFO + + +@@ -32,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.5.orig/debian/patches/02_manpage_additions.patch +++ memcached-1.4.5/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 --- memcached-1.4.5.orig/debian/patches/03_fix_ftbfs_gcc_45.patch +++ memcached-1.4.5/debian/patches/03_fix_ftbfs_gcc_45.patch @@ -0,0 +1,50 @@ +Description: Fix FTBFS with gcc 4.5 +Origin: upstream, https://github.com/memcached/memcached/commit/df15887584f0025e7b188e408dd3c9f638d68518 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/687984 + +--- a/memcached.h ++++ b/memcached.h +@@ -77,18 +77,22 @@ + #define TAIL_REPAIR_TIME (3 * 3600) + + /* warning: don't use these macros with a function, as it evals its arg twice */ +-#define ITEM_get_cas(i) ((uint64_t)(((i)->it_flags & ITEM_CAS) ? \ +- *(uint64_t*)&((i)->end[0]) : 0x0)) +-#define ITEM_set_cas(i,v) { if ((i)->it_flags & ITEM_CAS) { \ +- *(uint64_t*)&((i)->end[0]) = v; } } ++#define ITEM_get_cas(i) (((i)->it_flags & ITEM_CAS) ? \ ++ (i)->data->cas : (uint64_t)0) + +-#define ITEM_key(item) (((char*)&((item)->end[0])) \ ++#define ITEM_set_cas(i,v) { \ ++ if ((i)->it_flags & ITEM_CAS) { \ ++ (i)->data->cas = v; \ ++ } \ ++} ++ ++#define ITEM_key(item) (((char*)&((item)->data)) \ + + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) + +-#define ITEM_suffix(item) ((char*) &((item)->end[0]) + (item)->nkey + 1 \ ++#define ITEM_suffix(item) ((char*) &((item)->data) + (item)->nkey + 1 \ + + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) + +-#define ITEM_data(item) ((char*) &((item)->end[0]) + (item)->nkey + 1 \ ++#define ITEM_data(item) ((char*) &((item)->data) + (item)->nkey + 1 \ + + (item)->nsuffix \ + + (((item)->it_flags & ITEM_CAS) ? sizeof(uint64_t) : 0)) + +@@ -302,7 +306,12 @@ + uint8_t it_flags; /* ITEM_* above */ + uint8_t slabs_clsid;/* which slab class we're in */ + uint8_t nkey; /* key length, w/terminating null and padding */ +- void * end[]; ++ /* this odd type prevents type-punning issues when we do ++ * the little shuffle to save space when not using CAS. */ ++ union { ++ uint64_t cas; ++ char end; ++ } data[]; + /* if it_flags & ITEM_CAS we have 8 bytes CAS */ + /* then null-terminated key */ + /* then " flags length\r\n" (no terminating null) */ --- memcached-1.4.5.orig/debian/patches/series +++ memcached-1.4.5/debian/patches/series @@ -0,0 +1,3 @@ +01_init_script_additions.patch +02_manpage_additions.patch +03_fix_ftbfs_gcc_45.patch