[Python-modules-commits] r20049 - in packages/celery/trunk/debian (6 files)
fladi-guest at users.alioth.debian.org
fladi-guest at users.alioth.debian.org
Thu Jan 19 08:26:37 UTC 2012
Date: Thursday, January 19, 2012 @ 08:26:35
Author: fladi-guest
Revision: 20049
Enable init scripts.
Added:
packages/celery/trunk/debian/patches/lsb-init.patch
packages/celery/trunk/debian/python-celery.default
Modified:
packages/celery/trunk/debian/changelog
packages/celery/trunk/debian/clean
packages/celery/trunk/debian/patches/series
packages/celery/trunk/debian/rules
Modified: packages/celery/trunk/debian/changelog
===================================================================
--- packages/celery/trunk/debian/changelog 2012-01-19 07:08:50 UTC (rev 20048)
+++ packages/celery/trunk/debian/changelog 2012-01-19 08:26:35 UTC (rev 20049)
@@ -1,3 +1,9 @@
+celery (2.4.6-2) unstable; urgency=low
+
+ * Enable init scripts.
+
+ -- Michael Fladischer <FladischerMichael at fladi.at> Thu, 19 Jan 2012 09:26:05 +0100
+
celery (2.4.6-1) unstable; urgency=low
* New upstream release.
Modified: packages/celery/trunk/debian/clean
===================================================================
--- packages/celery/trunk/debian/clean 2012-01-19 07:08:50 UTC (rev 20048)
+++ packages/celery/trunk/debian/clean 2012-01-19 08:26:35 UTC (rev 20049)
@@ -7,3 +7,4 @@
celery.egg-info/PKG-INFO
celery.egg-info/SOURCES.txt
celery.egg-info/requires.txt
+debian/python-celery.*.init
Added: packages/celery/trunk/debian/patches/lsb-init.patch
===================================================================
--- packages/celery/trunk/debian/patches/lsb-init.patch (rev 0)
+++ packages/celery/trunk/debian/patches/lsb-init.patch 2012-01-19 08:26:35 UTC (rev 20049)
@@ -0,0 +1,176 @@
+Description: LSB compliant headers and status actions
+ Upstream ships init script but they lack some LSB header and the (optional)
+ "status" action. This patch fixes both.
+Author: Michael Fladischer <FladischerMichael at fladi.at>
+Last-Update: 2012-01-18
+Forwarded: no
+
+--- a/contrib/generic-init.d/celeryd
++++ b/contrib/generic-init.d/celeryd
+@@ -16,6 +16,7 @@
+ # Default-Start: 2 3 4 5
+ # Default-Stop: 0 1 6
+ # Short-Description: celery task worker daemon
++# Description: Starts the Celery worker daemon for a single project.
+ ### END INIT INFO
+
+ #set -e
+@@ -26,14 +27,9 @@
+ DEFAULT_NODES="celery"
+ DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
+
+-# /etc/init.d/celeryd: start and stop the celery task worker daemon.
++[ -r "$CELERY_DEFAULTS" ] && . "$CELERY_DEFAULTS"
+
+-CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/celeryd"}
+-
+-test -f "$CELERY_DEFAULTS" && . "$CELERY_DEFAULTS"
+-if [ -f "/etc/default/celeryd" ]; then
+- . /etc/default/celeryd
+-fi
++[ -r /etc/default/celeryd ] && . /etc/default/celeryd
+
+ CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}}
+ CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}}
+@@ -126,7 +122,7 @@
+ ;;
+
+ status)
+- $CELERYCTL status
++ $CELERYCTL status || exit $?
+ ;;
+
+ restart)
+--- a/contrib/generic-init.d/celeryevcam
++++ b/contrib/generic-init.d/celeryevcam
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+ # ============================================
+-# celeryd - Starts the Celery worker daemon.
++# celeryevcam - Starts the Celery event snapshot daemon.
+ # ============================================
+ #
+ # :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}
+@@ -78,12 +78,13 @@
+ # Full path to the virtualenv environment to activate. Default is none.
+
+ ### BEGIN INIT INFO
+-# Provides: celeryev
++# Provides: celeryevcam
+ # Required-Start: $network $local_fs $remote_fs
+ # Required-Stop: $network $local_fs $remote_fs
+ # Default-Start: 2 3 4 5
+ # Default-Stop: 0 1 6
+ # Short-Description: celery event snapshots
++# Description: Starts the Celery event snapshots daemon for a single project.
+ ### END INIT INFO
+
+ # Cannot use set -e/bash -e since the kill -0 command will abort
+@@ -95,13 +96,9 @@
+ DEFAULT_LOG_LEVEL="INFO"
+ DEFAULT_CELERYEV="/usr/bin/celeryev"
+
+-if test -f /etc/default/celeryd; then
+- . /etc/default/celeryd
+-fi
++[ -r /etc/default/celeryd ] && . /etc/default/celeryd
+
+-if test -f /etc/default/celeryev; then
+- . /etc/default/celeryev
+-fi
++[ -r /etc/default/celeryev ] && . /etc/default/celeryev
+
+ CELERYEV=${CELERYEV:-$DEFAULT_CELERYEV}
+ CELERYEV_PID_FILE=${CELERYEV_PID_FILE:-${CELERYEV_PIDFILE:-$DEFAULT_PID_FILE}}
+@@ -197,7 +194,16 @@
+ --pidfile="$CELERYEV_PID_FILE"
+ }
+
+-
++status () {
++ pid=$(cat "$CELERYEV_PID_FILE")
++ kill -0 $pid 1>/dev/null 2>&1
++ if [ $? -eq 0 ]; then
++ echo "celeryevcam running"
++ else
++ echo "celeryevcam not running"
++ exit 1
++ fi
++}
+
+ case "$1" in
+ start)
+@@ -216,9 +222,12 @@
+ check_dev_null
+ start_evcam
+ ;;
++ status)
++ status
++ ;;
+
+ *)
+- echo "Usage: /etc/init.d/celeryev {start|stop|restart}"
++ echo "Usage: /etc/init.d/celeryev {start|stop|restart|status}"
+ exit 1
+ esac
+
+--- a/contrib/generic-init.d/celerybeat
++++ b/contrib/generic-init.d/celerybeat
+@@ -15,6 +15,7 @@
+ # Default-Start: 2 3 4 5
+ # Default-Stop: 0 1 6
+ # Short-Description: celery periodic task scheduler
++# Description: Starts the Celery periodic task scheduler.
+ ### END INIT INFO
+
+ # Cannot use set -e/bash -e since the kill -0 command will abort
+@@ -26,15 +27,9 @@
+ DEFAULT_LOG_LEVEL="INFO"
+ DEFAULT_CELERYBEAT="celerybeat"
+
+-# /etc/init.d/ssh: start and stop the celery task worker daemon.
++[ -r /etc/default/celeryd ] && . /etc/default/celeryd
+
+-if test -f /etc/default/celeryd; then
+- . /etc/default/celeryd
+-fi
+-
+-if test -f /etc/default/celerybeat; then
+- . /etc/default/celerybeat
+-fi
++[ -r /etc/default/celerybeat ] && . /etc/default/celerybeat
+
+ CELERYBEAT=${CELERYBEAT:-$DEFAULT_CELERYBEAT}
+ CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-${CELERYBEAT_PIDFILE:-$DEFAULT_PID_FILE}}
+@@ -125,7 +120,16 @@
+ --pidfile="$CELERYBEAT_PID_FILE"
+ }
+
+-
++status () {
++ pid=$(cat "$CELERYBEAT_PID_FILE")
++ kill -0 $pid 1>/dev/null 2>&1
++ if [ $? -eq 0 ]; then
++ echo "celerybeat running"
++ else
++ echo "celerybeat not running"
++ exit 1
++ fi
++}
+
+ case "$1" in
+ start)
+@@ -144,9 +148,12 @@
+ check_dev_null
+ start_beat
+ ;;
++ status)
++ status
++ ;;
+
+ *)
+- echo "Usage: /etc/init.d/celerybeat {start|stop|restart}"
++ echo "Usage: /etc/init.d/celerybeat {start|stop|restart|status}"
+ exit 1
+ esac
+
Modified: packages/celery/trunk/debian/patches/series
===================================================================
--- packages/celery/trunk/debian/patches/series 2012-01-19 07:08:50 UTC (rev 20048)
+++ packages/celery/trunk/debian/patches/series 2012-01-19 08:26:35 UTC (rev 20049)
@@ -1,2 +1,3 @@
+lsb-init.patch
fix_dependencies.patch
intersphinx.patch
Added: packages/celery/trunk/debian/python-celery.default
===================================================================
--- packages/celery/trunk/debian/python-celery.default (rev 0)
+++ packages/celery/trunk/debian/python-celery.default 2012-01-19 08:26:35 UTC (rev 20049)
@@ -0,0 +1,35 @@
+# Edit the options in this file to match your projects environment.
+# See http://ask.github.com/celery/cookbook/daemonizing.html for the complete
+# documentation on the options.
+
+# WARNING: This script is only designed to run the worker(s) for a single
+# project. If you need to start workers for multiple projects you should
+# consider using supervisor.
+# Examples can be found in /usr/share/doc/python-celery/supervisord/
+
+# Change this to true when done to enable the init.d script.
+# Default: false
+ENABLED=false
+
+# Name of nodes to start
+# here we have a single node
+CELERYD_NODES="w1"
+# or we could have three nodes:
+#CELERYD_NODES="w1 w2 w3"
+
+# Where to chdir at start.
+CELERYD_CHDIR="/opt/Myproject/"
+
+# Extra arguments to celeryd
+CELERYD_OPTS="--time-limit=300 --concurrency=8"
+
+# Name of the celery config module.
+CELERY_CONFIG_MODULE="celeryconfig"
+
+# %n will be replaced with the nodename.
+CELERYD_LOG_FILE="/var/log/celery/%n.log"
+CELERYD_PID_FILE="/var/run/celery/%n.pid"
+
+# Workers should run as an unprivileged user.
+CELERYD_USER="celery"
+CELERYD_GROUP="celery"
Modified: packages/celery/trunk/debian/rules
===================================================================
--- packages/celery/trunk/debian/rules 2012-01-19 07:08:50 UTC (rev 20048)
+++ packages/celery/trunk/debian/rules 2012-01-19 08:26:35 UTC (rev 20049)
@@ -35,3 +35,11 @@
rm -rf .build
dh_clean
+.PHONY: override_dh_installinit
+override_dh_installinit:
+ ln contrib/generic-init.d/celerybeat debian/python-celery.celerybeat.init
+ ln contrib/generic-init.d/celeryd debian/python-celery.celeryd.init
+ ln contrib/generic-init.d/celeryevcam debian/python-celery.celeryevcam.init
+ dh_installinit --name celerybeat
+ dh_installinit --name celeryd
+ dh_installinit --name celeryevcam
More information about the Python-modules-commits
mailing list