A
A
Alexey2020-07-28 20:25:54
linux
Alexey, 2020-07-28 20:25:54

How to set environment variables for a user who doesn't have a shell?

Linux Mint.
There is a wsgi application that runs as www-data. The task is to pass some settings to the application through environment variables. I'm trying to get them through os.environ. I write variables in /etc/environment, but the application does not see them. I output everything that is in os.environ:

environ({'MAILTO': '-----', 'LANG': 'en_US.UTF-8', 'PWD': '/var/www/site', 'SHELL': '/bin/sh', 'LOGNAME': 'www-data', 'PATH': '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin', 'OLDPWD': '/var/www', 'HOME': '/var/www'})

What you need is not. Where to write them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-07-28
@alenov

Write to wsgi-server configuration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question