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

search path for configuration file not covering all documented cases (relative to executable) #1080

Open
ctheune opened this issue Mar 22, 2018 · 0 comments

Comments

@ctheune
Copy link

ctheune commented Mar 22, 2018

The documentation shows two variants of supervisor(d|ctl) picking up the config file, two of which are "relative to the executable":

 5. ../etc/supervisord.conf (Relative to the executable)
 6. ../supervisord.conf (Relative to the executable)

However, the code for that search is highly dependent on the current working directory as it takes sys.argv[0] without paying attention to making the executable path absolute first. So if you, for example, enter the bin/ directory of a virtualenv and run ./supervisorctl, then the '../etc/supervisord' will never match because using dirname() on ./supervisorctl won't always give you the parent directory.

I suggest to using os.path.abspath (which will automatically pick up the cwd) and explicitly joining that with '../etc/supervisord.conf'), the same for variant 6.

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

No branches or pull requests

1 participant