瀏覽代碼

Fixed several typos in the init scripts + docs

Ask Solem 14 年之前
父節點
當前提交
40f98a2c6b

+ 2 - 2
contrib/centos/celeryd.init

@@ -19,7 +19,7 @@
 #   CELERYD_CHDIR="/opt/Myproject/"
 #
 #   # Extra arguments to celeryd
-#   CELERYD_OPTS="--time-limit 300"
+#   CELERYD_OPTS="--time-limit=300"
 #
 #   # Name of the celery config module.#
 #   CELERY_CONFIG_MODULE="celeryconfig"
@@ -31,7 +31,7 @@
 #   CELERYD_CHDIR="/opt/Project/"
 #
 #   # Name of the projects settings module.
-#   DJANGO_SETTINGS_MODULE="settings"
+#   export DJANGO_SETTINGS_MODULE="settings"
 #
 #   # Path to celeryd
 #   CELERYD="/opt/Project/manage.py"

+ 2 - 2
contrib/debian/init.d/celerybeat

@@ -18,7 +18,7 @@
 #   CELERYD_CHDIR="/opt/Myproject/"
 #
 #   # Extra arguments to celeryd
-#   CELERYD_OPTS="--time-limit 300"
+#   CELERYD_OPTS="--time-limit=300"
 #
 #   # Extra arguments to celerybeat
 #   CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
@@ -33,7 +33,7 @@
 #   CELERYD_CHDIR="/opt/Project/"
 #
 #   # Name of the projects settings module.
-#   DJANGO_SETTINGS_MODULE="settings"
+#   export DJANGO_SETTINGS_MODULE="settings"
 #
 #   # Path to celeryd
 #   CELERYD="/opt/Project/manage.py celeryd"

+ 2 - 2
contrib/debian/init.d/celeryd

@@ -20,7 +20,7 @@
 #   CELERYD_CHDIR="/opt/Myproject/"
 #
 #   # Extra arguments to celeryd
-#   CELERYD_OPTS="--time-limit 300"
+#   CELERYD_OPTS="--time-limit=300"
 #
 #   # Name of the celery config module.#
 #   CELERY_CONFIG_MODULE="celeryconfig"
@@ -32,7 +32,7 @@
 #   CELERYD_CHDIR="/opt/Project/"
 #
 #   # Name of the projects settings module.
-#   DJANGO_SETTINGS_MODULE="settings"
+#   export DJANGO_SETTINGS_MODULE="settings"
 #
 #   # Path to celeryd
 #   CELERYD="/opt/Project/manage.py"

+ 0 - 178
contrib/debian/init.d/celeryd-multi

@@ -1,178 +0,0 @@
-#!/bin/sh -e
-
-### BEGIN INIT INFO
-# Provides:          celeryd-multi
-# 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 task multiple workers daemon
-### END INIT INFO
-
-# OS X Debug replacements to lsb-functions.
-#log_action_msg () {
-#    echo $*
-#}
-#log_daemon_msg () {
-#    echo $*
-#}
-#log_end_msg () {
-#    if [ $1 -eq 0 ]; then
-#        echo "ok"
-#    else
-#        echo "failed!"
-#    fi
-#}
-
-set -e
-
-CELERYD_PID_FILE="/var/run/celeryd-%n.pid"
-CELERYD_LOG_FILE="/var/log/celeryd-%n.log"
-CELERYD_LOG_LEVEL="INFO"
-CELERYD_NUM_WORKERS=2
-DEFAULT_CELERYD="celeryd"
-
-# /etc/init.d/celeryd-multi start and stop the celery task worker daemon.
-
-if test -f /etc/default/celeryd; then
-    . /etc/default/celeryd
-fi
-
-export CELERY_LOADER
-
-. /lib/lsb/init-functions
-
-CELERYD_OPTS="$CELERYD_OPTS -f $CELERYD_LOG_FILE -l $CELERYD_LOG_LEVEL"
-
-if [ -n "$2" ]; then
-    CELERYD_OPTS="$CELERYD_OPTS $2"
-fi
-
-# Extra start-stop-daemon options, like user/group.
-if [ -n "$CELERYD_USER" ]; then
-    DAEMON_OPTS="$DAEMON_OPTS --chuid $CELERYD_USER"
-fi
-if [ -n "$CELERYD_GROUP" ]; then
-    DAEMON_OPTS="$DAEMON_OPTS --group $CELERYD_GROUP"
-fi
-
-
-# Are we running from init?
-run_by_init() {
-    ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
-}
-
-
-check_dev_null() {
-    if [ ! -c /dev/null ]; then
-	if [ "$1" = log_end_msg ]; then
-	    log_end_msg 1 || true
-	fi
-	if ! run_by_init; then
-	    log_action_msg "/dev/null is not a character device!"
-	fi
-	exit 1
-    fi
-}
-
-
-export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
-if [ ! -z "$VIRTUALENV" ]; then
-    export PATH="$VIRTUALENV/bin:$PATH"
-    CELERYD="$VIRTUALENV/bin/$CELERYD"
-fi
-
-
-if [ -f "$CELERYD" -a ! -x "$CELERYD" ]; then
-    echo "ERROR: $CELERYD is not executable."
-    echo "Please make it executable by doing: chmod +x '$CELERYD'"
-
-    echo "celeryd is disabled"
-    exit
-fi
-
-WORKERS=$CELERYD_NUM_WORKERS
-
-stop_worker () {
-    cmd="start-stop-daemon  --stop --quiet $* --pidfile $CELERYD_PID_FILE"
-    stopcmd=`celeryd-multi expand "$cmd" $WORKERS`
-    log_daemon_msg "Stopping celery task workers..."
-    if eval "$stopcmd"; then
-        log_end_msg 0
-    else
-        log_end_msg 1
-    fi
-}
-
-start_worker () {
-    check_dev_null
-    cmd="start-stop-daemon --start $DAEMON_OPTS \
-                                    --quiet --oknodo --background \
-                                    --make-pidfile $* \
-                                    --pidfile $CELERYD_PID_FILE \
-                                    --exec $CELERYD --"
-    for wname in `celeryd-multi names $WORKERS $CELERYD_OPTS`; do
-        log_daemon_msg "Starting celery task worker" "$wname"
-        startcmd=`celeryd-multi get "$wname" $WORKERS --cmd="$cmd" $CELERYD_OPTS`
-        if `$startcmd`; then
-            log_end_msg 0
-        else
-            log_end_msg 1
-        fi
-    done
-}
-
-case "$1" in
-  start)
-    start_worker
-    ;;
-  stop)
-    stop_worker --oknodo
-    ;;
-
-  reload|force-reload)
-    echo "Use start+stop"
-    ;;
-
-  restart)
-    stop_worker --retry 30 --oknodo
-    start_worker
-    ;;
-
-  try-restart)
-    log_daemon_msg "Restarting celery task worker server" "celeryd"
-    set +e
-    stop_worker --retry 30
-    RET="$?"
-    set -e
-    case $RET in
-        0)
-		# old daemon stopped
-		check_dev_null log_end_msg
-        start_worker
-		;;
-	    1)
-		# daemon not running
-		log_progress_msg "(not running)"
-		log_end_msg 0
-		;;
-	    *)
-		# failed to stop
-		log_progress_msg "(failed to stop)"
-		log_end_msg 1
-		;;
-	esac
-	;;
-
-  status)
-    pidfiles=`celeryd-multi expand "$CELERYD_PID_FILE" $WORKERS $DAEMON_OPTS`
-    for pidfile in $pidfiles; do
-        status_of_proc -p $pidfile $CELERYD celeryd && exit 0 || exit $?
-    done
-	;;
-  *)
-	log_action_msg "Usage: /etc/init.d/celeryd-multi {start|stop|force-reload|restart|try-restart|status}"
-	exit 1
-esac
-
-exit 0

+ 1 - 1
contrib/debian/init.d/celeryevcam

@@ -35,7 +35,7 @@
 #   CELERYD_CHDIR="/opt/Project/"
 #
 #   # Name of the projects settings module.
-#   DJANGO_SETTINGS_MODULE="settings"
+#   export DJANGO_SETTINGS_MODULE="settings"
 #
 #   # Path to celeryd
 #   CELERYEV="/opt/Project/manage.py"

+ 2 - 2
contrib/generic-init.d/celeryd

@@ -25,7 +25,7 @@
 #   CELERYD_CHDIR="/opt/Myproject/"
 #
 #   # Extra arguments to celeryd
-#   CELERYD_OPTS="--time-limit 300"
+#   CELERYD_OPTS="--time-limit=300"
 #
 #   # Name of the celery config module.#
 #   CELERY_CONFIG_MODULE="celeryconfig"
@@ -37,7 +37,7 @@
 #   CELERYD_CHDIR="/opt/Project/"
 #
 #   # Name of the projects settings module.
-#   DJANGO_SETTINGS_MODULE="settings"
+#   export DJANGO_SETTINGS_MODULE="settings"
 #
 #   # Path to celeryd
 #   CELERYD="/opt/Project/manage.py celeryd"

+ 7 - 7
docs/cookbook/daemonizing.rst

@@ -64,8 +64,8 @@ This is an example configuration for a Python project.
     CELERYD_PID_FILE="/var/run/celery/%n.pid"
 
     # Workers should run as an unprivileged user.
-    CELERYD_USER = "celery"
-    CELERYD_GROUP = "celery"
+    CELERYD_USER="celery"
+    CELERYD_GROUP="celery"
 
 .. _generic-initd-celeryd-django-example:
 
@@ -96,8 +96,8 @@ This is an example configuration for those using `django-celery`::
     CELERYD_PID_FILE="/var/run/celery/%n.pid"
 
     # Workers should run as an unprivileged user.
-    CELERYD_USER = "celery"
-    CELERYD_GROUP = "celery"
+    CELERYD_USER="celery"
+    CELERYD_GROUP="celery"
 
     # Name of the projects settings module.
     export DJANGO_SETTINGS_MODULE="settings"
@@ -171,7 +171,7 @@ This is an example configuration for a Python project.
     CELERYD_CHDIR="/opt/Myproject/"
 
     # Extra arguments to celeryd
-    CELERYD_OPTS="--time-limit 300"
+    CELERYD_OPTS="--time-limit=300"
 
     # Name of the celery config module.#
     CELERY_CONFIG_MODULE="celeryconfig"
@@ -243,7 +243,7 @@ This is an example configuration for a Python project:
     CELERYD_CHDIR="/opt/Myproject/"
 
     # Extra arguments to celeryd
-    CELERYD_OPTS="--time-limit 300"
+    CELERYD_OPTS="--time-limit=300"
 
     # Extra arguments to celerybeat
     CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
@@ -262,7 +262,7 @@ This is an example configuration for those using `django-celery`::
     CELERYD_CHDIR="/opt/Project/"
 
     # Name of the projects settings module.
-    DJANGO_SETTINGS_MODULE="settings"
+    export DJANGO_SETTINGS_MODULE="settings"
 
     # Path to celeryd
     CELERYD="/opt/Project/manage.py celeryd"