I'm using the amazing utility supervisord
I'm happily running a few apps editing the config file as follows:
[program: Django Dev Server]
command=python /path/to/project/manage.py runserver 127.0.0.1:8000
[program: MongoDB]
command=sudo /path/to/mongod
Now problem is that some apps need a few 开发者_Python百科commands before they start up in order to prepare them for startup.
e.g. verifying conditions, cleaning folders, etc...
Any ideas?
Instead of calling manage.py
, write a script (call it, say, start_manage.py
) which verifies conditions, cleans folders, etc, and then calls manage.py
(using subprocess.Popen
). Or, of course, start_manage
could be a shell script if that fits your needs better.
Then change the config file to run
command=python start_manage.py
精彩评论