summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-python/celery/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-python/celery/files')
-rw-r--r--dev-python/celery/files/celery-3.0.11-require-python-dateutil-2.1.patch47
-rw-r--r--dev-python/celery/files/celery-3.0.12-require-python-dateutil-2.1.patch47
-rw-r--r--dev-python/celery/files/celery-3.1.10-test.patch33
-rw-r--r--dev-python/celery/files/celery-3.1.11-test.patch16
-rw-r--r--dev-python/celery/files/celery-docs.patch19
-rw-r--r--dev-python/celery/files/celery.confd70
-rw-r--r--dev-python/celery/files/celery.confd-r150
-rw-r--r--dev-python/celery/files/celery.initd268
-rw-r--r--dev-python/celery/files/celery.initd-r1214
9 files changed, 764 insertions, 0 deletions
diff --git a/dev-python/celery/files/celery-3.0.11-require-python-dateutil-2.1.patch b/dev-python/celery/files/celery-3.0.11-require-python-dateutil-2.1.patch
new file mode 100644
index 000000000000..90cdcb6d5f1c
--- /dev/null
+++ b/dev-python/celery/files/celery-3.0.11-require-python-dateutil-2.1.patch
@@ -0,0 +1,47 @@
+From ae721b6947e7e05f26dc8438fe61106b5e993e12 Mon Sep 17 00:00:00 2001
+From: Ask Solem <ask@celeryproject.org>
+Date: Fri, 17 Aug 2012 16:16:08 +0100
+Subject: [PATCH] Now depends on dateutil-2.1 which supports Py2.6, 2.7 and
+ 3.2+. Closes #915
+
+---
+ requirements/default-py3k.txt | 2 +-
+ requirements/default.txt | 2 +-
+ setup.cfg | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/requirements/default-py3k.txt b/requirements/default-py3k.txt
+index d68a7bd..a8bd31f 100644
+--- a/requirements/default-py3k.txt
++++ b/requirements/default-py3k.txt
+@@ -1,4 +1,4 @@
+ billiard>=2.7.3.17
+-python-dateutil>=2.0
++python-dateutil>=2.1
+ pytz
+ kombu>=2.4.7,<3.0
+diff --git a/requirements/default.txt b/requirements/default.txt
+index 2f50735..855cfc7 100644
+--- a/requirements/default.txt
++++ b/requirements/default.txt
+@@ -1,3 +1,3 @@
+ billiard>=2.7.3.17
+-python-dateutil>=1.5,<2.0
++python-dateutil>=2.1
+ kombu>=2.4.7,<3.0
+diff --git a/setup.cfg b/setup.cfg
+index 0e537f8..5ac1409 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -15,7 +15,7 @@
+
+ [bdist_rpm]
+ requires = billiard>=2.7.3.17
+- python-dateutil >= 1.5
++ python-dateutil >= 2.1
+ kombu >= 2.4.7
+
+ [egg_info]
+--
+1.7.10
+
diff --git a/dev-python/celery/files/celery-3.0.12-require-python-dateutil-2.1.patch b/dev-python/celery/files/celery-3.0.12-require-python-dateutil-2.1.patch
new file mode 100644
index 000000000000..6df08727d125
--- /dev/null
+++ b/dev-python/celery/files/celery-3.0.12-require-python-dateutil-2.1.patch
@@ -0,0 +1,47 @@
+From ae721b6947e7e05f26dc8438fe61106b5e993e12 Mon Sep 17 00:00:00 2001
+From: Ask Solem <ask@celeryproject.org>
+Date: Fri, 17 Aug 2012 16:16:08 +0100
+Subject: [PATCH] Now depends on dateutil-2.1 which supports Py2.6, 2.7 and
+ 3.2+. Closes #915
+
+---
+ requirements/default-py3k.txt | 2 +-
+ requirements/default.txt | 2 +-
+ setup.cfg | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/requirements/default-py3k.txt b/requirements/default-py3k.txt
+index d68a7bd..a8bd31f 100644
+--- a/requirements/default-py3k.txt
++++ b/requirements/default-py3k.txt
+@@ -1,4 +1,4 @@
+ billiard>=2.7.3.17
+-python-dateutil>=2.0
++python-dateutil>=2.1
+ pytz
+ kombu>=2.4.7,<3.0
+diff --git a/requirements/default.txt b/requirements/default.txt
+index 2f50735..855cfc7 100644
+--- a/requirements/default.txt
++++ b/requirements/default.txt
+@@ -1,3 +1,3 @@
+ billiard>=2.7.3.17
+-python-dateutil>=1.5,<2.0
++python-dateutil>=2.1
+ kombu>=2.4.7,<3.0
+diff --git a/setup.cfg b/setup.cfg
+index 0e537f8..5ac1409 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -15,7 +15,7 @@
+
+ [bdist_rpm]
+ requires = billiard >= 2.7.3.18
+- python-dateutil >= 1.5
++ python-dateutil >= 2.1
+ kombu >= 2.4.8
+
+ [egg_info]
+--
+1.7.10
+
diff --git a/dev-python/celery/files/celery-3.1.10-test.patch b/dev-python/celery/files/celery-3.1.10-test.patch
new file mode 100644
index 000000000000..94fcac92fbf3
--- /dev/null
+++ b/dev-python/celery/files/celery-3.1.10-test.patch
@@ -0,0 +1,33 @@
+https://github.com/celery/celery/commit/fb48b1f357f7a416d1413d0056158a74191185af.diff
+diff --git a/celery/tests/backends/test_mongodb.py b/celery/tests/backends/test_mongodb.py
+index f7546d3..a32d9ed 100644
+--- a/celery/tests/backends/test_mongodb.py
++++ b/celery/tests/backends/test_mongodb.py
+@@ -196,9 +196,10 @@ def test_get_task_meta_for(self, mock_get_database):
+ mock_get_database.assert_called_once_with()
+ mock_database.__getitem__.assert_called_once_with(MONGODB_COLLECTION)
+ self.assertEqual(
+- ['status', 'task_id', 'date_done', 'traceback', 'result',
+- 'children'],
+- list(ret_val.keys()))
++ list(sorted(['status', 'task_id', 'date_done', 'traceback',
++ 'result', 'children'])),
++ list(sorted(ret_val.keys())),
++ )
+
+ @patch('celery.backends.mongodb.MongoBackend._get_database')
+ def test_get_task_meta_for_no_result(self, mock_get_database):
+@@ -253,8 +253,8 @@ def test_restore_group(self, mock_get_database):
+ mock_collection.find_one.assert_called_once_with(
+ {'_id': sentinel.taskset_id})
+ self.assertEqual(
+- ['date_done', 'result', 'task_id'],
+- list(ret_val.keys()),
++ list(sorted(['date_done', 'result', 'task_id'])),
++ list(sorted(ret_val.keys())),
+ )
+
+ @patch('celery.backends.mongodb.MongoBackend._get_database')
+#diff -ur celery-3.1.10.orig/celery/tests/backends/test_mongodb.py celery-3.1.10/celery/tests/backends/test_mongodb.py
+#--- celery-3.1.10.orig/celery/tests/backends/test_mongodb.py 2014-02-28 21:43:26.000000000 +0800
+#+++ celery-3.1.10/celery/tests/backends/test_mongodb.py 2014-04-17 11:43:00.818430253 +0800
diff --git a/dev-python/celery/files/celery-3.1.11-test.patch b/dev-python/celery/files/celery-3.1.11-test.patch
new file mode 100644
index 000000000000..b09d464252cf
--- /dev/null
+++ b/dev-python/celery/files/celery-3.1.11-test.patch
@@ -0,0 +1,16 @@
+https://github.com/celery/celery/commit/fb48b1f357f7a416d1413d0056158a74191185af.diff
+diff --git a/celery/tests/backends/test_mongodb.py b/celery/tests/backends/test_mongodb.py
+index f7546d3..a32d9ed 100644
+--- a/celery/tests/backends/test_mongodb.py
++++ b/celery/tests/backends/test_mongodb.py
+@@ -253,8 +253,8 @@ def test_restore_group(self, mock_get_database):
+ mock_collection.find_one.assert_called_once_with(
+ {'_id': sentinel.taskset_id})
+ self.assertEqual(
+- ['date_done', 'result', 'task_id'],
+- list(ret_val.keys()),
++ list(sorted(['date_done', 'result', 'task_id'])),
++ list(sorted(ret_val.keys())),
+ )
+
+ @patch('celery.backends.mongodb.MongoBackend._get_database')
diff --git a/dev-python/celery/files/celery-docs.patch b/dev-python/celery/files/celery-docs.patch
new file mode 100644
index 000000000000..5e09718feb2c
--- /dev/null
+++ b/dev-python/celery/files/celery-docs.patch
@@ -0,0 +1,19 @@
+# Prevent un-needed objects.inv files
+diff -ur celery-3.0.19.orig/docs/conf.py celery-3.0.19/docs/conf.py
+--- docs/conf.py 2013-04-15 22:51:46.000000000 +0800
++++ docs/conf.py 2013-04-27 21:46:25.070423582 +0800
+@@ -74,14 +74,6 @@
+ # If true, '()' will be appended to :func: etc. cross-reference text.
+ add_function_parentheses = True
+
+-intersphinx_mapping = {
+- 'python': ('http://docs.python.org/dev', None),
+- 'kombu': ('http://kombu.readthedocs.org/en/latest/', None),
+- 'djcelery': ('http://django-celery.readthedocs.org/en/latest', None),
+- 'cyme': ('http://cyme.readthedocs.org/en/latest', None),
+- 'amqp': ('http://amqp.readthedocs.org/en/latest', None),
+-}
+-
+ # The name of the Pygments (syntax highlighting) style to use.
+ pygments_style = 'colorful'
+
diff --git a/dev-python/celery/files/celery.confd b/dev-python/celery/files/celery.confd
new file mode 100644
index 000000000000..b952c9817c14
--- /dev/null
+++ b/dev-python/celery/files/celery.confd
@@ -0,0 +1,70 @@
+# /etc/conf.d/celery
+
+##############################################################################
+# GLOBAL CONFIGURATION
+
+# User and group
+#CELERY_USER="celery"
+#CELERY_GROUP="celery"
+
+# Is this for a django project ?
+# If 'yes' it will automatically setup CELERYD, CELERYCTL
+# CELERYD_MULTI, CELERYBEAT, CELERYEV and CELERYEV_CAM for a
+# django project, but you can still override them here.
+#CELERY_DJANGO="yes"
+
+# This is generaly a good idea to set the environment correctly
+# because a lot of python package try to use HOME on init
+#export HOME="/var/lib/myproject"
+
+# Full path to the python project directory.
+#CELERY_PROJDIR="/var/lib/myproject"
+
+##############################################################################
+# CELERYD
+
+#CELERYD_ENABLED="yes"
+
+# celeryd notes
+#CELERYD_NODES="celery"
+
+# celeryd options
+# Example: 5 minute hard time limit for tasks
+#CELERYD_OPTS="--time-limit=300"
+
+# Location and level of the celeryd log file
+#CELERYD_LOG_FILE=/var/log/celery/celeryd@%n.log
+#CELERYD_LOG_LEVEL="INFO"
+
+# Location of the celeryd pid file
+#CELERYD_PID_FILE=/var/run/celery/celeryd@%n.pid
+
+##############################################################################
+# CELERYBEAT
+
+#CELERYBEAT_ENABLED="yes"
+
+# celerybeat options
+#CELERYBEAT_OPTS=""
+
+# Location and level of the celerybeat log file
+#CELERYBEAT_LOG_FILE=/var/log/celery/celerybeat.log
+#CELERYBEAT_LOG_LEVEL="INFO"
+
+# Location of the celerybeat pid file
+#CELERYBEAT_PID_FILE=/var/run/celery/celerybeat.pid
+
+##############################################################################
+# CELERYEV
+
+#CELERYEV_ENABLED="yes"
+
+# celeryev options
+#CELERYEV_OPTS=""
+
+# Location and level of the celeryev log file
+#CELERYEV_LOG_FILE=/var/log/celery/celeryev.log
+#CELERYEV_LOG_LEVEL="INFO"
+
+# Location of the celeryev pid file
+#CELERYEV_PID_FILE=/var/run/celery/celeryev.pid
diff --git a/dev-python/celery/files/celery.confd-r1 b/dev-python/celery/files/celery.confd-r1
new file mode 100644
index 000000000000..17254e840d12
--- /dev/null
+++ b/dev-python/celery/files/celery.confd-r1
@@ -0,0 +1,50 @@
+# /etc/conf.d/celery
+
+##############################################################################
+# GLOBAL CONFIGURATION
+
+# User and group
+#CELERY_USER="celery"
+#CELERY_GROUP="celery"
+
+# This is generaly a good idea to set the environment correctly
+# because a lot of python package try to use HOME on init
+#export HOME="/var/lib/myproject"
+
+# Full path to the python project directory.
+#CELERY_PROJDIR="/var/lib/myproject"
+
+##############################################################################
+# CELERYD
+
+#CELERYD_ENABLED="yes"
+
+# celeryd notes
+#CELERYD_NODES="celery"
+
+# celeryd options
+# Example: set a 5 minute hard time limit for tasks, disable queue process prefetching and specify an app module from CELERY_PROJDIR
+#CELERYD_OPTS="--time-limit=300 -Ofair -A celeryapp"
+
+# Location and level of the celeryd log file
+#CELERYD_LOG_FILE=/var/log/celery/celeryd@%n.log
+#CELERYD_LOG_LEVEL="INFO"
+
+# Location of the celeryd pid file
+#CELERYD_PID_FILE=/var/run/celery/celeryd@%n.pid
+
+##############################################################################
+# CELERYBEAT
+
+#CELERYBEAT_ENABLED="yes"
+
+# celerybeat options
+#CELERYBEAT_OPTS=""
+
+# Location and level of the celerybeat log file
+#CELERYBEAT_LOG_FILE=/var/log/celery/celerybeat.log
+#CELERYBEAT_LOG_LEVEL="INFO"
+
+# Location of the celerybeat pid file
+#CELERYBEAT_PID_FILE=/var/run/celery/celerybeat.pid
+
diff --git a/dev-python/celery/files/celery.initd b/dev-python/celery/files/celery.initd
new file mode 100644
index 000000000000..67be68b5840f
--- /dev/null
+++ b/dev-python/celery/files/celery.initd
@@ -0,0 +1,268 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the BSD license
+# $Id$
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ use rabbitmq logger dns
+}
+
+CELERYD_ENABLED=${CELERYD_ENABLED:-"no"}
+CELERYD_PID_FILE=${CELERYD_PID_FILE:-"/var/run/celery/celeryd@%n.pid"}
+CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-"/var/log/celery/celeryd@%n.log"}
+CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-"INFO"}
+CELERYD_NODES=${CELERYD_NODES:-"celery"}
+
+CELERYBEAT_ENABLED=${CELERYBEAT_ENABLED:-"no"}
+CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-"/var/run/celery/celerybeat.pid"}
+CELERYBEAT_LOG_FILE=${CELERYBEAT_LOG_FILE:-"/var/log/celery/celerybeat.log"}
+CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-"INFO"}
+
+CELERYEV_ENABLED=${CELERYEV_ENABLED:-"no"}
+CELERYEV_PID_FILE=${CELERYEV_PID_FILE:-"/var/run/celery/celeryev.pid"}
+CELERYEV_LOG_FILE=${CELERYEV_LOG_FILE:-"/var/log/celery/celeryev.log"}
+CELERYEV_LOG_LEVEL=${CELERYEV_LOG_LEVEL:-"INFO"}
+
+export CELERY_LOADER
+
+if yesno "$CELERY_DJANGO"; then
+ CELERYD=${CELERYD:-"celeryd_detach"}
+ CELERYCTL=${CELERYCTL:-"python manage.py celery"}
+ CELERYD_MULTI=${CELERYD_MULTI:-"python manage.py celeryd_multi"}
+ CELERYBEAT=${CELERYBEAT:-"python manage.py celerybeat"}
+ CELERYEV=${CELERYEV:-"python manage.py celeryev"}
+ CELERYEV_CAM=${CELERYEV_CAM:-"djcelery.snapshot.Camera"}
+else
+ CELERYD=${CELERYD:-"-m celery.bin.celeryd_detach"}
+ CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"}
+ CELERYCTL=${CELERYCTL:-"celeryctl"}
+ CELERYBEAT=${CELERYBEAT:-"celerybeat"}
+ CELERYEV=${CELERYEV:-"celeryev"}
+fi
+
+CELERYD_OPTS="$CELERYD_OPTS"
+CELERYBEAT_OPTS="$CELERYBEAT_OPTS -f $CELERYBEAT_LOG_FILE -l $CELERYBEAT_LOG_LEVEL"
+CELERYEV_OPTS="$CELERYEV_OPTS -f $CELERYEV_LOG_FILE -l $CELERYEV_LOG_LEVEL -c $CELERYEV_CAM"
+
+create_dirs() {
+ local logfile="$1"
+ local pidfile="$2"
+ local logdir=$(dirname $logfile)
+ local piddir=$(dirname $pidfile)
+
+ checkpath -d -q -m 0750 -o ${CELERY_USER:-"root"}:${CELERY_GROUP:-"root"} $logdir $piddir
+}
+
+if [ -n "$CELERY_USER" ]; then
+ DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERY_USER"
+fi
+if [ -n "$CELERY_GROUP" ]; then
+ DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERY_GROUP"
+fi
+
+checkconfig() {
+ if [ ! -c /dev/null ]; then
+ eerror "/dev/null is not a character device!"
+ return 1
+ fi
+
+ if [ -z "$CELERY_PROJDIR" ]; then
+ eerror "Missing CELERY_PROJDIR variable"
+ return 1
+ fi
+
+ if yesno "$CELERYD_ENABLED"; then
+ create_dirs "$CELERYD_LOG_FILE" "$CELERYD_PID_FILE"
+ fi
+
+ if yesno "$CELERYBEAT_ENABLED"; then
+ create_dirs "$CELERYBEAT_LOG_FILE" "$CELERYBEAT_PID_FILE"
+ fi
+
+ if yesno "$CELERYEV_ENABLED"; then
+ create_dirs "$CELERYEV_LOG_FILE" "$CELERYEV_PID_FILE"
+
+ if [ -z "$CELERYEV_CAM" ]; then
+ eerror "Missing CELERYEV_CAM variable"
+ return 1
+ fi
+ fi
+
+ return 0
+}
+
+celery_chdir() {
+ if [ -n "$CELERY_PROJDIR" ]; then
+ cd "$CELERY_PROJDIR"
+ fi
+}
+
+wait_pid () {
+ local pidfile=$1
+ local timeout=${STOPTIMEOUT:-"10"}
+ local PID=$(cat "${pidfile}" 2>/dev/null)
+
+ while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
+ kill -0 $PID 2>/dev/null || break
+ kill -TERM "$PID"
+ timeout=$(($timeout - 1))
+ sleep 0.5
+ done
+
+ [[ "${timeout}" -lt 1 ]] && return 1
+ [ -f $pidfile ] && rm -f $pidfile
+ return 0
+}
+
+# celeryd
+start_workers() {
+ yesno "${CELERYD_ENABLED}" || return 0
+
+ $CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ --cmd="$CELERYD" \
+ $CELERYD_OPTS
+}
+
+stop_workers() {
+ yesno "${CELERYD_ENABLED}" || return 0
+
+ local timeout=${STOPTIMEOUT:-"10"}
+
+ $CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE" || return 1
+
+ # Wait for each node
+ for node in $CELERYD_NODES; do
+ local pidfile=${CELERYD_PID_FILE/\%n/$node}
+ local PID=$(cat "${pidfile}" 2>/dev/null)
+ while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
+ kill -0 $PID 2>/dev/null || break
+ timeout=$(($timeout - 1))
+ sleep 0.5
+ done
+ done
+
+ [[ "${timeout}" -lt 1 ]] && return 1
+ return 0
+}
+
+restart_workers() {
+ yesno "${CELERYD_ENABLED}" || return 0
+
+ $CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ --cmd="$CELERYD" \
+ $CELERYD_OPTS
+}
+
+# celeryev
+start_ev() {
+ yesno "${CELERYEV_ENABLED}" || return 0
+
+ ebegin "Starting celeryev"
+ $CELERYEV $CELERYEV_OPTS $DAEMON_OPTS --detach \
+ --pidfile="$CELERYEV_PID_FILE"
+ eend $?
+}
+
+
+stop_ev() {
+ yesno "${CELERYEV_ENABLED}" || return 0
+
+ ebegin "Stopping celeryev"
+ if [ -f "$CELERYEV_PID_FILE" ]; then
+ wait_pid "$CELERYEV_PID_FILE"
+ else
+ ewarn "not running"
+ fi
+ eend $?
+}
+
+# celerybeat
+start_beat() {
+ yesno "${CELERYBEAT_ENABLED}" || return 0
+
+ ebegin "Starting celerybeat"
+ $CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
+ --pidfile="$CELERYBEAT_PID_FILE"
+ eend $?
+}
+
+
+stop_beat() {
+ yesno "${CELERYBEAT_ENABLED}" || return 0
+
+ ebegin "Stopping celerybeat"
+ if [ -f "$CELERYBEAT_PID_FILE" ]; then
+ wait_pid "$CELERYBEAT_PID_FILE"
+ else
+ ewarn "not running"
+ fi
+ eend $?
+}
+
+
+start() {
+ local cr=0
+
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ eindent
+
+ celery_chdir && \
+ start_workers && \
+ start_beat && \
+ start_ev || cr=1
+
+ eoutdent
+ eend $cr
+}
+
+stop() {
+ local cr=0
+
+ checkconfig || return 1
+
+ ebegin "Stopping ${SVCNAME}"
+ eindent
+
+ celery_chdir
+ stop_workers || cr=1
+ stop_beat || cr=1
+ stop_ev || cr=1
+
+ eoutdent
+ eend $cr
+}
+
+reload() {
+ local cr=0
+
+ checkconfig || return 1
+
+ ebegin "Restarting ${SVCNAME}"
+ eindent
+
+ celery_chdir
+ restart_workers || cr=1
+ stop_beat && start_beat || cr=1
+ stop_ev && start_ev || cr=1
+
+ eoutdent
+ eend $cr
+}
+
+status() {
+ checkconfig || return 1
+
+ celery_chdir && \
+ ${CELERYCTL} status
+}
diff --git a/dev-python/celery/files/celery.initd-r1 b/dev-python/celery/files/celery.initd-r1
new file mode 100644
index 000000000000..2fcd6d95fbdf
--- /dev/null
+++ b/dev-python/celery/files/celery.initd-r1
@@ -0,0 +1,214 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the BSD license
+# $Id$
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ use rabbitmq redis logger dns
+}
+
+CELERYD_ENABLED=${CELERYD_ENABLED:-"no"}
+CELERYD_PID_FILE=${CELERYD_PID_FILE:-"/var/run/celery/celeryd@%n.pid"}
+CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-"/var/log/celery/celeryd@%n.log"}
+CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-"INFO"}
+CELERYD_NODES=${CELERYD_NODES:-"celery"}
+
+CELERYBEAT_ENABLED=${CELERYBEAT_ENABLED:-"no"}
+CELERYBEAT_PID_FILE=${CELERYBEAT_PID_FILE:-"/var/run/celery/celerybeat.pid"}
+CELERYBEAT_LOG_FILE=${CELERYBEAT_LOG_FILE:-"/var/log/celery/celerybeat.log"}
+CELERYBEAT_LOG_LEVEL=${CELERYBEAT_LOG_LEVEL:-"INFO"}
+
+export CELERY_LOADER
+
+CELERYD_MULTI=${CELERYD_MULTI:-"celery multi"}
+CELERYCTL=${CELERYCTL:-"celery"}
+CELERYBEAT=${CELERYBEAT:-"celery beat"}
+
+CELERYD_OPTS="$CELERYD_OPTS"
+CELERYBEAT_OPTS="$CELERYBEAT_OPTS -f $CELERYBEAT_LOG_FILE -l $CELERYBEAT_LOG_LEVEL"
+
+create_dirs() {
+ local logfile="$1"
+ local pidfile="$2"
+ local logdir=$(dirname $logfile)
+ local piddir=$(dirname $pidfile)
+
+ checkpath -d -q -m 0750 -o ${CELERY_USER:-"root"}:${CELERY_GROUP:-"root"} $logdir $piddir
+}
+
+if [ -n "$CELERY_USER" ]; then
+ DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERY_USER"
+fi
+if [ -n "$CELERY_GROUP" ]; then
+ DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERY_GROUP"
+fi
+
+checkconfig() {
+ if [ ! -c /dev/null ]; then
+ eerror "/dev/null is not a character device!"
+ return 1
+ fi
+
+ if [ -z "$CELERY_PROJDIR" ]; then
+ eerror "Missing CELERY_PROJDIR variable"
+ return 1
+ fi
+
+ if yesno "$CELERYD_ENABLED"; then
+ create_dirs "$CELERYD_LOG_FILE" "$CELERYD_PID_FILE"
+ fi
+
+ if yesno "$CELERYBEAT_ENABLED"; then
+ create_dirs "$CELERYBEAT_LOG_FILE" "$CELERYBEAT_PID_FILE"
+ fi
+
+ return 0
+}
+
+celery_chdir() {
+ if [ -n "$CELERY_PROJDIR" ]; then
+ cd "$CELERY_PROJDIR"
+ fi
+}
+
+wait_pid () {
+ local pidfile=$1
+ local timeout=${STOPTIMEOUT:-"10"}
+ local PID=$(cat "${pidfile}" 2>/dev/null)
+
+ while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
+ kill -0 $PID 2>/dev/null || break
+ kill -TERM "$PID"
+ timeout=$(($timeout - 1))
+ sleep 0.5
+ done
+
+ [[ "${timeout}" -lt 1 ]] && return 1
+ [ -f $pidfile ] && rm -f $pidfile
+ return 0
+}
+
+# celeryd
+start_workers() {
+ yesno "${CELERYD_ENABLED}" || return 0
+
+ $CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ $CELERYD_OPTS
+}
+
+stop_workers() {
+ yesno "${CELERYD_ENABLED}" || return 0
+
+ local timeout=${STOPTIMEOUT:-"10"}
+
+ $CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE" || return 1
+
+ # Wait for each node
+ for node in $CELERYD_NODES; do
+ local pidfile=${CELERYD_PID_FILE/\%n/$node}
+ local PID=$(cat "${pidfile}" 2>/dev/null)
+ while [[ -n "$PID" && "${timeout}" -ge 1 ]] ; do
+ kill -0 $PID 2>/dev/null || break
+ timeout=$(($timeout - 1))
+ sleep 0.5
+ done
+ done
+
+ [[ "${timeout}" -lt 1 ]] && return 1
+ return 0
+}
+
+restart_workers() {
+ yesno "${CELERYD_ENABLED}" || return 0
+
+ $CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
+ --pidfile="$CELERYD_PID_FILE" \
+ --logfile="$CELERYD_LOG_FILE" \
+ --loglevel="$CELERYD_LOG_LEVEL" \
+ $CELERYD_OPTS
+}
+
+# celerybeat
+start_beat() {
+ yesno "${CELERYBEAT_ENABLED}" || return 0
+
+ ebegin "Starting celerybeat"
+ $CELERYBEAT $CELERYBEAT_OPTS $DAEMON_OPTS --detach \
+ --pidfile="$CELERYBEAT_PID_FILE"
+ eend $?
+}
+
+
+stop_beat() {
+ yesno "${CELERYBEAT_ENABLED}" || return 0
+
+ ebegin "Stopping celerybeat"
+ if [ -f "$CELERYBEAT_PID_FILE" ]; then
+ wait_pid "$CELERYBEAT_PID_FILE"
+ else
+ ewarn "not running"
+ fi
+ eend $?
+}
+
+
+start() {
+ local cr=0
+
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ eindent
+
+ celery_chdir && \
+ start_workers && \
+ start_beat || cr=1
+
+ eoutdent
+ eend $cr
+}
+
+stop() {
+ local cr=0
+
+ checkconfig || return 1
+
+ ebegin "Stopping ${SVCNAME}"
+ eindent
+
+ celery_chdir
+ stop_workers || cr=1
+ stop_beat || cr=1
+
+ eoutdent
+ eend $cr
+}
+
+reload() {
+ local cr=0
+
+ checkconfig || return 1
+
+ ebegin "Restarting ${SVCNAME}"
+ eindent
+
+ celery_chdir
+ restart_workers || cr=1
+ stop_beat && start_beat || cr=1
+
+ eoutdent
+ eend $cr
+}
+
+status() {
+ checkconfig || return 1
+
+ celery_chdir && \
+ ${CELERYCTL} status
+}