2017-02-11 130 views
0

在Debian生產服務器上運行Celery,在無法在項目'dir中編寫的用戶下,但初始化芹菜節拍需要創建文件來存儲pid(celerybeat.pid)。芹菜Django 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' 

如何更改該文件的位置?

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

還是其他解決方案來避免這種情況?

謝謝

回答

0

你有沒有試過deamonizing?
編輯文件/etc/default/celeryd:並設置CELERYD_PID_FILE="/var/run/celery/celerybeat.pid"
你可以在這裏找到一些更詳細的文檔[芹菜deamonizing配置示例] [1]

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

我希望這有助於:-)

+0

嗨。是的,我正試着從監督開始。芹菜工人的工作,但沒有打敗。 與Django的設置是在Django的設置文件。我有條目: CELERYBEAT_PID_FILE =「/var/run/celery/celerybeat.pid」 但無論如何日誌說:celery.platforms.LockFailed:[Errno 13]權限被拒絕:'/pathtoproject/celerybeat.pid' 似乎像這樣的設置不能被應用或者像這樣 – napilnik