Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5931267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:40:12+00:00 2026-05-22T14:40:12+00:00

I have an Ubuntu server set up with 5 different django sites running on

  • 0

I have an Ubuntu server set up with 5 different django sites running on it. These are used for testing, so each developer has their own site and database as well as one site for integrated code which is only updated when features are ready. Jenkins is used to update each site from Github whenever changes are pushed to the repository.

We recently added Django-Celery to our dependencies so that we can do some processing on uploaded files asynchronously. Each site now needs its own celery queue that uses the correct settings (database, upload directory, etc.) for that particular site.

I want to restart each celery server whenever code changes so it can get the latest changes automatically. We have an update script within our git repository that Jenkins runs whenever it updates a site. When I try to start a celery daemon within this script, celery starts, but shuts down again at the end of the script.

Here’s a copy of my update script:

#!/bin/bash

# Delete all *.pyc files
find $WORKSPACE -name '*.pyc' | xargs rm

# Update the database
[…]

# Run automated tests
python code/manage.py test <project> --noinput
TEST_STATUS=$?

# Refresh this repo's public website
touch $WORKSPACE/apache/wsgi.py

# Restart our celery daemon for this installation
/sbin/start-stop-daemon --stop -p $WORKSPACE/../celery.pid
echo 'Starting Celery Server'

# When run on the command line, this line starts a daemon just fine
/sbin/start-stop-daemon --start --background --quiet --oknodo -p $WORKSPACE/../celery.pid -m --exec $WORKSPACE/code/manage.py -- celeryd --logfile=$WORKSPACE/../celery.log

echo 'Celery Server Status: '$?

exit $TEST_STATUS

Here’s a copy of the celery log during the execution of this script:

[2011-05-10 20:45:41,286: WARNING/MainProcess] -------------- celery@ip-10-227-139-6 v2.2.6
---- **** -----
--- * ***  * -- [Configuration]
-- * - **** ---   . broker:      djkombu.transport.DatabaseTransport://guest@localhost:5672/
- ** ----------   . loader:      djcelery.loaders.DjangoLoader
- ** ----------   . logfile:     /var/lib/jenkins/jobs/mpdaugherty-farmforce/workspace/../celery.log@WARNING
- ** ----------   . concurrency: 1
- ** ----------   . events:      OFF
- *** --- * ---   . beat:        OFF
-- ******* ----
--- ***** ----- [Queues]
 --------------   . celery:      exchange:celery (direct) binding:celery
[2011-05-10 20:45:41,333: WARNING/MainProcess] celery@ip-10-227-139-6 has started.
[2011-05-10 20:46:28,481: WARNING/MainProcess] celeryd: Warm shutdown (MainProcess)

Any advice for how I can get the celery daemons started by Jenkins to not shut down? Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:40:13+00:00Added an answer on May 22, 2026 at 2:40 pm

    One of my coworkers finally made this work. Instead of starting the Celery daemon directly, we use at to schedule it immediately and disconnect from the current shell.

    Instead of:

    # Restart our celery daemon for this installation
    /sbin/start-stop-daemon --stop -p $WORKSPACE/../celery.pid
    echo 'Starting Celery Server'
    
    # When run on the command line, this line starts a daemon just fine
    /sbin/start-stop-daemon --start --background --quiet --oknodo -p $WORKSPACE/../celery.pid -m --exec $WORKSPACE/code/manage.py -- celeryd --logfile=$WORKSPACE/../celery.log
    

    Change to:

    # Restart our celery daemon for this installation
    echo "/sbin/start-stop-daemon --stop -p $WORKSPACE/../celery.pid
    echo 'Starting Celery Server'" | at now
    
    # When run on the command line, this line starts a daemon just fine
    echo "/sbin/start-stop-daemon --start --background --quiet --oknodo -p $WORKSPACE/../celery.pid -m --exec $WORKSPACE/code/manage.py -- celeryd --logfile=$WORKSPACE/../celery.log" | at now
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ubuntu 10.04 server, running PHP 5.3.2 and I have these lines
I have two different servers each running a Ubuntu installation. On both of them,
I have a server that is running Ubuntu Linux Server Edition. I once had
Our setup as follows: We have a local development server running Ubuntu, with a
I have a PHP server at home for development. It is running: Ubuntu 9.10
I have an Ubuntu Server and wanted to install subversion and set up some
I am running an Ubuntu Server. I would like for it to have a
Im having some problems sending mail. I have a ubuntu server running postfix as
So I've setup an Ubuntu server running the 8.04 release. I set it up
Just trying out ubuntu server on my pc and have been testing some commands

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.