0

Running Celery with Django on Debian production server under user that can't write in project' dir, but while initialization celery beat needs to create file to store pid (celerybeat.pid).

>   File
> "/webapps/bookingsoft2016/lib/python3.5/site-packages/celery/platforms.py",
> line 213, in write_pid
>     pidfile_fd = os.open(self.path, PIDFILE_FLAGS, PIDFILE_MODE) celery.platforms.LockFailed: [Errno 13] Permission denied:
> '/path_to_project/celerybeat.pid'

How can I change location of that file?

--pidfile=/var/run/celery/celerybeat.pid - doesn't seems to work

Or any other solution to avoid this?

Thanks

napilnik
  • 117
  • 2
  • 8

1 Answers1

0

Have you tried deamonizing ?
Edit the file /etc/default/celeryd: and set CELERYD_PID_FILE="/var/run/celery/celerybeat.pid"
You can find some more detail documentation here [celery deamonizing example configuration][1]

[1]: http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#example-configuration

I hope this helps :-)

Madra David
  • 151
  • 1
  • 8
  • hi. Yes, I am trying to start it with superviser. Celery worker works, but beat no. With django settings are in django settings file. And I have entry there: CELERYBEAT_PID_FILE = "/var/run/celery/celerybeat.pid" But anyway log says: celery.platforms.LockFailed: [Errno 13] Permission denied: '/pathtoproject/celerybeat.pid' Seems like this setting can't be applied or smthg like that – napilnik Feb 11 '17 at 12:02