0

I have hacked together an rc script for celeryd on FreeBSD, but I can't help but think that there must be a better way. celeryd does not daemonize itself, and it seems to have a hard time responding to sigterm as well, so it might be complicated to get to work.

Is this a problem that someone else has solved before?

Chris R
  • 17,546
  • 23
  • 105
  • 172

1 Answers1

1

There's an experimental init.d script here: https://github.com/ask/celery/tree/master/contrib/generic-init.d/

I don't know if it has been tested on FreeBSD, but it should definitely be made to work there.

What do you mean celeryd isn't responding to TERM? This is the recommended signal to use for a clean shutdown as it will finish any currently running tasks. (there's no time out, so it doesn't help if you have a task in deadlock, for that you may use the --time-limit argument)

Here's the /etc/default/celeryd file I use (it's for a Django project, for others just replace manage.py celeryd with celeryd): http://pastie.org/1216111

celerybeat/celeryevcam is using the scripts from contrib/debian/init.d, there are no generic versions of these yet.

asksol
  • 19,129
  • 5
  • 61
  • 68
  • In terms of not responding to TERM, I've put in an issue on github; basically, I thought it was not responding to TERM, but it turns out it just takes about 6 minutes to do so. As to the init script, FreeBSD's rc scripts are pretty wildly different from the linux init scripts I'm familiar with (including that one). Once I've got some more work into the one I hacked together, I'll probably submit it back to the core celery project. – Chris R Nov 12 '10 at 15:13