Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two patches #1006

Closed
wants to merge 3 commits into from
Closed

two patches #1006

wants to merge 3 commits into from

Conversation

anqfsh
Copy link

@anqfsh anqfsh commented Oct 20, 2017

  1. fixed the issue: the message url will redirect to root. this will be a problem when supervisor is deployed into a subdir instead of the root of the website.

  2. add a new directive I really need: autodir
    can use it in the conf file like this:
    autodir=%(ENV_XXXX)s/tmp/%(program_name)s,%(ENV_XXXX)s/logs/%(program_name)s

will create the separate logs and tmp directory for every program

@mnaberez
Copy link
Member

fixed the issue: the message url will redirect to root. this will be a problem when supervisor is deployed into a subdir instead of the root of the website.

This will be fixed by #593.

add a new directive I really need: autodir

Sorry, but I don't think we will add a feature that creates arbitrary directories from a comma-separated list in the config file.

If you need to create some directories, or perform any other kind of initialization before your program is run, you can do something like the following:

Original:

[program:myprogram]
command = myprogram

Change it to:

[program:myprogram]
command = bash -c start_myprogram.sh

Contents of start_myprogram.sh:

#!/bin/bash 
mkdir dir1
mkdir dir2 
exec myprogram

It will create the directories and then the exec will cause the process to be replaced by myprogram, so the end effect is the same as if myprogram was started by supervisord directly.

@FAKERINHEART
Copy link

FAKERINHEART commented Feb 27, 2018

I think it is necessary to add create log dir by supervisor instead of every sub-process, for these log are written into by supervisor, not the sub-process. And it is necessary for supervisor to have enough permission to access them. In addition, the log dir of supervisord itself is also need to be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants