Scripting Celery to Start on Windows 2012

96 views
Skip to first unread message

Robert Ross

unread,
Feb 23, 2021, 4:01:39 AM2/23/21
to OpenREM
Hi

I'm happily running OpenREM with exports now.  The server periodically reboots (as planned, for updates and patches etc) and OpenREM doesn't restart automatically, so I put some scripts in the startup folder and OpenREM itself works.  However, Celery doesn't start when I batch script:

celery worker -n default -Ofair -A openremproject -c 4 -Q default ^ --pidfile=C:\path\to\media\celery\default.pid --logfile=C:\path\to\media\celery\default.log

because it can't find the openremproject.  If I put a cd C:\path\to\openremproject line above the celery line, PowerShell ignores it, and PowerShell runs the batch scripts by default.  I've tried to write a PowerShell script to launch cmd.exe to run the celery command, but the child window closes immediately after launch.    

Has anyone come across this and found a solution?  I'm sure I could get cmd.exe working or use functions in PowerShell, but it'll take a while, so if someone has a prior solution, I'd love to hear it.

Kind regards
Robert


dpla...@gmail.com

unread,
Feb 24, 2021, 3:02:29 AM2/24/21
to OpenREM
Hi Robert,

I have a set of batch files that are run by the Windows task scheduler. These start Celery and Flower when the server reboots. My scripts are the basis of this page of the OpenREM documentation:

https://docs.openrem.org/en/0.10.0-docs/celery-windows.html

Hopefully that will help.

Kind regards,

David

Reply all
Reply to author
Forward
0 new messages