Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Run in a system service / without configuration #20122

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

Closed
piegamesde opened this issue Apr 30, 2021 · 0 comments · Fixed by #20123
Closed

Run in a system service / without configuration #20122

piegamesde opened this issue Apr 30, 2021 · 0 comments · Fixed by #20123
Milestone

Comments

@piegamesde
Copy link

Problem

I'm trying to run a python service that transitively depends on matplotlib. When starting, matplotlib crashes on the try to somehow get a configuration directory, because neither $HOME nor $XDG_CONFIG_HOME are set (of course, why would they be in a system service?). I tried working around by setting MPLCONFIGDIR, but to no effect – it still crashes on line 415. This too makes sense when looking at the code, because _get_config_or_cache_dir already takes in xdg_base as an input – even though it may not necessarily be used.

This is not the only problematic place. I see that the font loading handler also tries to access $HOME, and there are probably even more places

Proposed Solution

I don't know matplotlib, and what it needs config/cache for. Ideally, this would somehow be an optional feature. It seems that there already is some code to handle the case where the specified directories are not writable, which falls back to some temporary directories. It would be cool if this fallback was also used when $HOME or some other environment variables are not set.

Additional context and prior art

My service is a Flask application, running with gunicorn as a systemd service.

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

Successfully merging a pull request may close this issue.

2 participants