debian/0000775000000000000000000000000012264775103007177 5ustar debian/install0000664000000000000000000000002512263767657010603 0ustar beanstalkd /usr/bin/ debian/beanstalkd.socket0000664000000000000000000000024512263267173012524 0ustar [Unit] Description=Beanstalkd socket Documentation=man:beanstalkd(1) Before=sockets.target [Socket] ListenStream=127.0.0.1:11300 [Install] WantedBy=sockets.target debian/rules0000775000000000000000000000231212263565317010260 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # for beanstalkd test scripts export VERBOSE=1 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) # no libsystemd-daemon on non-linux arches ifeq ($(DEB_HOST_ARCH_OS), linux) export DEB_LDFLAGS_MAINT_APPEND = -lsystemd-daemon export DEB_CFLAGS_MAINT_APPEND = -DUSE_EXTERNAL_SD_DAEMON=1 endif %: dh $@ --with systemd override_dh_prep: dh_prep -X beanstalkd.spec override_dh_auto_install: dh_install dh_installman # silly acrobatics to preserve an upstream file override_dh_auto_clean: dh_testdir mv beanstalkd.spec beanstalkd.spec_ dh_auto_clean mv beanstalkd.spec_ beanstalkd.spec override_dh_systemd_enable: # Enable the service dh_systemd_enable beanstalkd.service # Do not enable the socket on install, but disable it on purge dh_systemd_enable --no-enable beanstalkd.socket override_dh_installinit: # This makes sure systemd's socket activation will not start the # service during the upgrade and also minimizes service downtime. dh_installinit --restart-after-upgrade .PHONY: override_dh_prep override_dh_auto_install override_dh_auto_clean \ override_dh_systemd_enable override_dh_installinit debian/source/0000775000000000000000000000000012240144606010467 5ustar debian/source/format0000664000000000000000000000001412240144606011675 0ustar 3.0 (quilt) debian/default0000664000000000000000000000056412240144606010543 0ustar ## Defaults for the beanstalkd init script, /etc/init.d/beanstalkd on ## Debian systems. BEANSTALKD_LISTEN_ADDR=127.0.0.1 BEANSTALKD_LISTEN_PORT=11300 # You can use BEANSTALKD_EXTRA to pass additional options. See beanstalkd(1) # for a list of the available options. Uncomment the following line for # persistent job storage. #BEANSTALKD_EXTRA="-b /var/lib/beanstalkd" debian/postrm0000664000000000000000000000155712240144606010446 0ustar #!/bin/sh # vim: ts=4:et:sts=4 # $Id: beanstalkd.postrm 89 2009-01-03 16:34:01Z robert $ set -e #DEBHELPER# PACKAGE=beanstalkd DEFAULTSFILE=/etc/default/$PACKAGE case "$1" in failed-install|abort-install|abort-upgrade|failed-upgrade) exit 0 ;; remove) if [ -d /var/lib/beanstalkd ]; then if [ $(find /var/lib/beanstalkd | wc -l) -eq 1 ]; then rmdir /var/lib/beanstalkd fi fi exit 0 ;; purge) echo "purge requested, thus removing /var/lib/beanstalkd" rm -rf /var/lib/beanstalkd/ # remove user, group and home directory beanstalkd deluser --remove-home beanstalkd >/dev/null 2>&1 || true exit 0 ;; upgrade|disappear) exit 0 ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 ;; esac debian/doc-base0000664000000000000000000000037212240144606010571 0ustar Document: beanstalk-protocol Title: Beanstalkd protocol Author: Keith Rarick Abstract: Specification of the protocol clients can use to talk to beanstalkd Section: Network/Communication Format: Text Files: /usr/share/doc/beanstalkd/protocol.txt.gz debian/docs0000664000000000000000000000003012240144606010033 0ustar README doc/protocol.txt debian/compat0000664000000000000000000000000212240144606010365 0ustar 9 debian/copyright0000664000000000000000000000333712240144606011130 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: http://kr.github.com/beanstalkd/download.html Upstream-Contact: Keith Rarick  Files: * Copyright: Copyright © 2007-2012 The Beanstalkd Authors License: MIT Files: sd-daemon.* Copyright: Copyright © 2010 Lennart Poettering License: MIT Files: ct/* Copyright: Copyright © 2010, 2011 Keith Rarick License: MIT Files: debian/* Copyright: Copyright © 2009 Serafeim Zanikolas Copyright © 2013 Apollon Oikonomopoulos Copyright © 2013 Gregory Potamianos License: MIT License: MIT Copyright (c) 2007-2011 The Beanstalkd Authors. . 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. debian/init0000664000000000000000000002031312240144606010054 0ustar #!/bin/sh # # Copyright (c) 2007 Javier Fernandez-Sanguino # # This is free software; you may redistribute it and/or modify # it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2, # or (at your option) any later version. # # This is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License with # the Debian operating system, in /usr/share/common-licenses/GPL; if # not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA # ### BEGIN INIT INFO # Provides: beanstalkd # Required-Start: $remote_fs $network $local_fs # Required-Stop: $remote_fs $network $local_fs # Should-Start: $named # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: in-memory workqueue service # Description: beanstalk is a simple, fast, queueing server. Its # interface is generic, but was originally designed # for reducing the latency of page views in high-volume # web applications by running time-consuming tasks # asynchronously. ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/beanstalkd # Introduce the server's location here NAME=beanstalkd # Introduce the short server's name here DESC="in-memory queueing server" # Introduce a short description here #LOGDIR=/var/log/beanstalkd # Log directory to use PIDFILE=/var/run/$NAME.pid test -x $DAEMON || exit 0 . /lib/lsb/init-functions # Default options, these can be overriden by the information # at /etc/default/$NAME BEANSTALKD_LISTEN_ADDR="127.0.0.1" BEANSTALKD_LISTEN_PORT=11300 BEANSTALKD_EXTRA="" #DIETIME=10 # Time to wait for the server to die, in seconds # If this value is set too low you might not # let some servers to die gracefully and # 'restart' will not work STARTTIME=1 # Time to wait for the server to start, in seconds # If this value is set each time the server is # started (on start or restart) the script will # stall to try to determine if it is running # If it is not set and the server takes time # to setup a pid file the log message might # be a false positive (says it did not start # when it actually did) #LOGFILE=$LOGDIR/$NAME.log # Server logfile DAEMONUSER=beanstalkd # Users to run the daemons as. If this value # is set start-stop-daemon will chuid the server # Include defaults if available if [ -f /etc/default/$NAME ] ; then . /etc/default/$NAME fi DAEMON_OPTS="-l $BEANSTALKD_LISTEN_ADDR -p $BEANSTALKD_LISTEN_PORT $BEANSTALKD_EXTRA" # Check that the user exists (if we set a user) # Does the user exist? if [ -n "$DAEMONUSER" ] ; then if getent passwd | grep -q "^$DAEMONUSER:"; then # Obtain the uid and gid DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` else log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." exit 0 fi fi set -e running_pid() { # Check if a given process pid's cmdline matches a given name pid=$1 name=$2 [ -z "$pid" ] && return 1 [ ! -d /proc/$pid ] && return 1 cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` # Is this the expected server [ "$cmd" != "$name" ] && return 1 return 0 } running() { # Check if the process is running looking at /proc # (works for all users) # No pidfile, probably no daemon present [ ! -f "$PIDFILE" ] && return 1 pid=`cat $PIDFILE` running_pid $pid $DAEMON || return 1 return 0 } start_server() { # Start the process using the wrapper if [ -z "$DAEMONUSER" ] ; then start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS errcode=$? else # if we are using a daemonuser then change the user id start-stop-daemon --start --quiet --pidfile $PIDFILE \ --chuid $DAEMONUSER --make-pidfile --oknodo \ --background --exec $DAEMON -- $DAEMON_OPTS errcode=$? fi return $errcode } stop_server() { # Stop the process using the wrapper if [ -z "$DAEMONUSER" ] ; then killproc -p $PIDFILE $DAEMON errcode=$? else # if we are using a daemonuser then look for process that match start-stop-daemon --stop --quiet --pidfile $PIDFILE \ --user $DAEMONUSER \ --exec $DAEMON errcode=$? fi rm -f $PIDFILE return $errcode } reload_server() { [ ! -f "$PIDFILE" ] && return 1 pid=pidofproc $PIDFILE # This is the daemon's pid # Send a SIGHUP kill -1 $pid return $? } force_stop() { # Force the process to die killing it manually [ ! -e "$PIDFILE" ] && return if running ; then kill -15 $pid # Is it really dead? sleep "$DIETIME"s if running ; then kill -9 $pid sleep "$DIETIME"s if running ; then echo "Cannot kill $NAME (pid=$pid)!" exit 0 fi fi fi rm -f $PIDFILE } case "$1" in start) log_daemon_msg "Starting $DESC " "$NAME" # Check if it's running first if running ; then log_progress_msg "apparently already running" log_end_msg 0 exit 0 fi if start_server ; then # NOTE: Some servers might die some time after they start, # this code will detect this issue if STARTTIME is set # to a reasonable value [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time if running ; then # It's ok, the server started and is running log_end_msg 0 else # It is not running after we did start log_end_msg 1 fi else # Either we could not start it log_end_msg 1 fi ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" if running ; then # Only stop the server if we see it running errcode=0 stop_server || errcode=$? log_end_msg $errcode else # If it's not running don't do anything log_progress_msg "apparently not running" log_end_msg 0 exit 0 fi ;; force-stop) # First try to stop gracefully the program $0 stop if running; then # If it's still running try to kill it more forcefully log_daemon_msg "Stopping (force) $DESC" "$NAME" errcode=0 force_stop || errcode=$? log_end_msg $errcode fi ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" errcode=0 stop_server || errcode=$? # Wait some sensible amount, some server need this [ -n "$DIETIME" ] && sleep $DIETIME start_server || errcode=$? [ -n "$STARTTIME" ] && sleep $STARTTIME running || errcode=$? log_end_msg $errcode ;; status) log_daemon_msg "Checking status of $DESC" "$NAME" if running ; then log_progress_msg "running" log_end_msg 0 else log_progress_msg "apparently not running ... " log_end_msg 1 exit 0 fi ;; reload) log_warning_msg "Reloading $NAME daemon: not implemented (use restart)." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0 debian/control0000664000000000000000000000244512264775060010611 0ustar Source: beanstalkd Section: net Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Gregory Potamianos Uploaders: Apollon Oikonomopoulos , Serafeim Zanikolas Build-Depends: debhelper (>= 9), libtool, net-tools, dh-systemd (>= 1.5), libsystemd-daemon-dev [linux-any] Standards-Version: 3.9.5 Homepage: http://kr.github.com/beanstalkd/ Vcs-Git: git://anonscm.debian.org/collab-maint/beanstalkd.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/beanstalkd.git Package: beanstalkd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, netbase Suggests: doc-base Description: simple, in-memory, workqueue service Beanstalkd is a simple, fast, workqueue service (a specific case of message queueing), in which messages are organised in "tubes". Beanstalk clients can insert and consume messages into and from such tubes. . The beanstalk interface is generic, but was originally designed for reducing the latency of page views in high-volume web applications by running time-consuming tasks asynchronously. . Beanstalkd is meant to be ran in a trusted network, as it has no authorisation/authentication mechanisms. . This package has the server files. debian/watch0000664000000000000000000000016312240144606010220 0ustar # Compulsory line, this is a version 3 file version=3 https://github.com/kr/beanstalkd/tags .*/v?(\d\S*)\.tar\.gz debian/changelog0000664000000000000000000001525012264775052011057 0ustar beanstalkd (1.9-2ubuntu1) trusty; urgency=medium * debian/patches/0003-Use-external-sd-daemon-on-linux.patch: Dropped causes FTBFS on Ubuntu. -- Chuck Short Mon, 13 Jan 2014 09:37:04 -0500 beanstalkd (1.9-2) unstable; urgency=medium [ Gregory Potamianos ] * Use debian libsystemd-daemon where available [ Apollon Oikonomopoulos ] * Add patch fixing segfault on interrupted epoll_wait. Thanks to Danny Guinther for the patch! (LP: #1263808) * Add Documentation field to the systemd unit file * Add systemd socket activation support * Restart beanstalkd after upgrade (and not during). This ensures that socket activation under systemd will work predictably during upgrades and also minimizes service downtime. -- Gregory Potamianos Thu, 09 Jan 2014 20:20:18 +0200 beanstalkd (1.9-1) unstable; urgency=low [ Gregory Potamianos ] * Imported Upstream version 1.9 * debian/watch: beanstalkd now uses github archive * debian/patches: drop 0003-Fix-FTBFS-in-hurd-i386.patch, merged upstream * debian/patches: refresh 0001-Fix-FTBFS-for-gnu-kfreebsd.patch * debian/patches: refresh 0002-Sanitize-Makefile.patch * debian/docs: removed NEWS.md, removed upstream * debian/default: remove obsolete variables * debian/control: Bump Standards-Version to 3.9.5 (no changes) [ Apollon Oikonomopoulos ] * Init script/defaults refactoring * Initial systemd support -- Gregory Potamianos Tue, 12 Nov 2013 15:26:11 +0200 beanstalkd (1.8-2) unstable; urgency=low * Add debian/patches/fix-hurd-ftbfs.patch to fix FTBFS in hurd * debian/control: Update homepage link * debian/control: Canonicalize Vcs-* fields * debian/patches/*: Make patches gbp-pq friendly -- Gregory Potamianos Sat, 13 Apr 2013 19:07:18 +0300 beanstalkd (1.8-1) unstable; urgency=low * New upstream (Closes: #701429, #704288) * Refresh debian/patches/freebsd-build.diff to apply on Makefile * Add debian/patch/sanitize_makefile.diff to play nice with debian hardened flags * Bump debhelper compat to 9 * Bump Standards version to 3.9.4 * Update debian/copyright to comply with copyright v1.0 * Friendly takeover (encouraged by old maintainer); setting Gregory Potamianos as Maintainer and Apollon Oikonomopoulos, Serafeim Zanikolas as Uploaders -- Gregory Potamianos Mon, 08 Apr 2013 13:23:01 +0300 beanstalkd (1.7-1) unstable; urgency=high * New upstream (Closes: #666775, #687402); high urgency due to RC bugs * Add Vcs-* headers in debian/control -- Serafeim Zanikolas Sat, 15 Sep 2012 12:18:05 +0200 beanstalkd (1.6-1) unstable; urgency=low * New upstream - drop build dependencies (python-minimal, procps, fiu-utils) due to re-organisation of tests - debian/rules: do not disable any tests - drop debian/patches/randomise-port.diff -- Serafeim Zanikolas Sun, 20 May 2012 18:57:56 +0200 beanstalkd (1.5-2) unstable; urgency=high * Add debian/patches/freebsd-build.diff to fix FTBFS for gnu/kfreebsd (Closes: #664613); high urgency due to RC bug -- Serafeim Zanikolas Sun, 01 Apr 2012 15:33:27 +0200 beanstalkd (1.5-1) unstable; urgency=low * New upstream - Drop Build-Depends on libevent-dev and autotools-dev - Update debian/copyright to reflect new upstream license - Drop debian/patches/rename-dprintf.diff (no longer necessary) - Update debian/docs for some docs that are no longer shipped - debian/rules: override default installation location, and skip tests sh-tests/binlog-v5.sh (requires beanstalkd 1.4.6) and pause-tube (race condition that may result in false positive) * Point debian/watch to github instead * Bump up Standards-Version to 3.9.3 (no changes) -- Serafeim Zanikolas Fri, 02 Mar 2012 00:32:53 +0100 beanstalkd (1.4.6-3) unstable; urgency=high * Patch sh-tests/common.functions to randomise the listener port during build tests (Closes: #636964); high urgency due to RC bug -- Serafeim Zanikolas Sun, 14 Aug 2011 15:46:45 +0200 beanstalkd (1.4.6-2) unstable; urgency=low * Apply upstream patch, rename-dprintf.diff, to fix FTBFS (Closes: #632762) * Bump up Standards-Version to 3.9.2 (no changes) -- Serafeim Zanikolas Sun, 10 Jul 2011 20:51:11 +0200 beanstalkd (1.4.6-1) unstable; urgency=medium * New upstream release * Fix bashism in the upstream, dynamically generated Makefile * Urgency set to medium because the new upstream release fixes a potential security issue (see upstream NEWS file) * debian/control:Maintainer: set to my debian email address -- Serafeim Zanikolas Sun, 30 May 2010 01:00:51 +0200 beanstalkd (1.4.4-2) unstable; urgency=low * debian/control:Build-Depends: require fiu-utils >=0.13-3, to test successfully on certain arches (see #574405 and #574752) * debian/postrm: fix test of whether /var/lib/beanstalkd is empty (would fail with subdirectories, which normally are not created there), and revise diagnostic messages -- Serafeim Zanikolas Thu, 25 Mar 2010 21:58:07 +0100 beanstalkd (1.4.4-1) unstable; urgency=low * New Upstream Release - drop make-tests-more-robust-and-tidy.diff (adopted upstream) - fixes failing build tests (Closes: #571357) * Modify /etc/default/beanstalkd for easier source'ing * debian/control:Build-Depends: replace netcat with python-minimal * debian/rules: run all build tests, and do so with verbosity -- Serafeim Zanikolas Mon, 15 Mar 2010 09:31:44 +0100 beanstalkd (1.4.3-2) unstable; urgency=low * Bump up Standards-Version to 3.8.4 (no changes) * Enable build-time tests - add make-tests-more-robust-and-tidy.diff - do not run tests unless loopback interface is configured - listen only on localhost, for security reasons - try listening on another port when the default is not available - cleanup named pipes that are left behind by fiu - debian/control: add Build-Depends: netcat, fiu-utils, procps, net-tools - debian/rules: ignore sh-tests/pause-tube.* (false negative) * debian/init: add Required-{Start,Stop}: $remote_fs for dep-based booting * debian/control - add Suggests: doc-base - revise package description to clarify that beanstalkd is a workqueue service, which is a specific case of messaging -- Serafeim Zanikolas Sun, 21 Feb 2010 16:34:00 +0100 beanstalkd (1.4.3-1) unstable; urgency=low * Initial release (Closes: #557128) -- Serafeim Zanikolas Wed, 18 Nov 2009 23:32:00 +0100 debian/NEWS0000664000000000000000000000165612263565333007707 0ustar beanstalkd (1.9-2) unstable; urgency=medium As of 1.9-2, beanstalkd ships a systemd socket unit file to facilitate socket activation via systemd. The socket activation is disabled by default, if you want to use it you need to stop the service and manually enable and start the systemd socket: $ systemctl stop beanstalkd.service $ systemctl enable beanstalkd.socket $ systemctl start beanstalkd.socket These steps need to be performed only once and will bind 127.0.0.1:11300 and pass it down to beanstalkd. Note that if you enable socket activation, the port and address specified in /etc/default/beanstalkd will not be used. As with all systemd unit files, you can override beanstalkd.socket by copying it to /etc/systemd/system/ and modifying it. For more information about socket activation, see systemd.socket(5). -- Apollon Oikonomopoulos Tue, 07 Jan 2014 12:33:36 +0200 debian/postinst0000664000000000000000000000115312240144606010775 0ustar #!/bin/sh set -e PACKAGE=beanstalkd DEFAULTSFILE=/etc/default/$PACKAGE case "$1" in configure) # Create beanstalkd system user getent passwd beanstalkd > /dev/null || \ adduser --quiet --system --home /var/lib/beanstalkd --no-create-home \ --gecos 'Beanstalk Server' --group beanstalkd ;; failed-upgrade|abort-upgrade|abort-remove|abort-deconfigure|in-favour|removing) ;; *) echo "postinst called with unknown argument \`$1'" >&2; exit 1; ;; esac chown beanstalkd:beanstalkd /var/lib/beanstalkd/ #DEBHELPER# exit 0 debian/beanstalkd.service0000664000000000000000000000050512262554562012673 0ustar [Unit] Description=Simple, fast work queue Documentation=man:beanstalkd(1) After=network.target [Service] User=beanstalkd Group=beanstalkd EnvironmentFile=/etc/default/beanstalkd ExecStart=/usr/bin/beanstalkd -l ${BEANSTALKD_LISTEN_ADDR} -p ${BEANSTALKD_LISTEN_PORT} $BEANSTALKD_EXTRAS [Install] WantedBy=multi-user.target debian/dirs0000664000000000000000000000004712263043616010060 0ustar var/lib/beanstalkd etc/default usr/bin debian/manpages0000664000000000000000000000002112240144606010676 0ustar doc/beanstalkd.1 debian/patches/0000775000000000000000000000000012264775012010625 5ustar debian/patches/0001-Fix-FTBFS-for-gnu-kfreebsd.patch0000664000000000000000000000071512240144606016746 0ustar From: Serafeim Zanikolas Date: Sun, 1 Apr 2012 15:48:45 +0200 Subject: Fix FTBFS for gnu/kfreebsd Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=664613 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ -g\ LDFLAGS= -OS=$(shell uname|tr A-Z a-z) +OS=$(shell uname -s | tr A-Z a-z | sed 's?gnu/kfreebsd?freebsd?') INSTALL=install VERS=$(shell ./vers.sh) debian/patches/0003-Use-external-sd-daemon-on-linux.patch0000664000000000000000000000272412246041103020206 0ustar From: Gregory Potamianos Date: Fri, 15 Nov 2013 16:29:08 +0200 Subject: Enable linking with debian libsystemd-daemon Compile and link with libsystemd-daemon on linux. Beanstalkd ships with sd-daemon in the upstream distribution. We use that only on arches where libsystemd-daemon is not available. --- a/net.c +++ b/net.c @@ -8,7 +8,12 @@ #include #include #include "dat.h" + +#ifdef USE_EXTERNAL_SD_DAEMON +#include +#else #include "sd-daemon.h" +#endif int make_server_socket(char *host, char *port) --- a/util.c +++ b/util.c @@ -4,7 +4,13 @@ #include #include #include + +#ifdef USE_EXTERNAL_SD_DAEMON +#include +#else #include "sd-daemon.h" +#endif + #include "dat.h" const char *progname; --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ OS=$(shell uname -s | tr A-Z a-z | sed 's?gnu/kfreebsd?freebsd?') INSTALL=install +DEB_HOST_ARCH_OS:=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS) VERS=$(shell ./vers.sh) TARG=beanstalkd MOFILE=main.o @@ -20,7 +21,6 @@ net.o\ primes.o\ prot.o\ - sd-daemon.o\ serv.o\ time.o\ tube.o\ @@ -28,6 +28,10 @@ vers.o\ walg.o\ +ifneq ($(DEB_HOST_ARCH_OS),linux) +OFILES += sd-daemon.o +endif + TOFILES=\ heap-test.o\ integ-test.o\ @@ -36,7 +40,10 @@ HFILES=\ dat.h\ - sd-daemon.h\ + +ifneq ($(DEB_HOST_ARCH_OS),linux) +HFILES += sd-daemon.h +endif CLEANFILES=\ vers.c\ debian/patches/series0000664000000000000000000000024112264775011012036 0ustar 0001-Fix-FTBFS-for-gnu-kfreebsd.patch 0002-Sanitize-Makefile.patch #0003-Use-external-sd-daemon-on-linux.patch 0004-fix-segfault-on-interrupted-epoll_wait.patch debian/patches/0004-fix-segfault-on-interrupted-epoll_wait.patch0000664000000000000000000000112512262554562021741 0ustar From fb0a46602de1d0884ea8c33d9e0896b464ccf4c6 Mon Sep 17 00:00:00 2001 From: Danny Guinther Date: Thu, 19 Dec 2013 09:17:14 -0500 Subject: [PATCH] Only process succesfully epoll_events --- linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux.c b/linux.c index 4564a09..8633441 100644 --- a/linux.c +++ b/linux.c @@ -79,7 +79,7 @@ socknext(Socket **s, int64 timeout) exit(1); } - if (r) { + if (r > 0) { *s = ev.data.ptr; if (ev.events & (EPOLLHUP|EPOLLRDHUP)) { return 'h'; -- 1.8.5.2 debian/patches/0002-Sanitize-Makefile.patch0000664000000000000000000000076212240146755015533 0ustar From: Gregory Potamianos Date: Wed, 10 Apr 2013 19:37:08 +0300 Subject: Sanitize Makefile Use debian CFLAGS and LDFLAGS instead of upstream's --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/Makefile +++ b/Makefile @@ -1,10 +1,9 @@ PREFIX=/usr/local BINDIR=$(PREFIX)/bin -CFLAGS=-Wall -Werror\ +CFLAGS?=-Wall -Werror\ -Wformat=2\ -g\ -LDFLAGS= OS=$(shell uname -s | tr A-Z a-z | sed 's?gnu/kfreebsd?freebsd?') INSTALL=install