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

1 Answer 1

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 :-)

1
  • 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, 2017 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.