3

I use uwsgi running in the emperor mode to serve multiple Django Applications on one server. Therefore for every project I have a own config file like this one:

<uwsgi>
    <master>true</master>
    <processes>1</processes>
    <vaccum>true</vaccum>
    <chmod-socket>666</chmod-socket>
    <socket>/tmp/%n.sock</socket>
    <uid>www-data</uid>
    <gid>www-data</gid>
    <pythonpath>%d../%n</pythonpath>
    <module>%n</module>
</uwsgi>

Everything works fine, the only thing which concerns me or which I don't completly understand is, when I run uwsgi with "uwsgi --emperor /home/user/apps/vassals/" I get the warning message "* WARNING: you are running uWSGI as root !!! (use the --uid flag) *".

Can I ignore that message or does it mean that uwsgi doesn't consider the uid gid settings in the project config files?

Many thanks. Mario

Mario
  • 33
  • 1
  • 3

2 Answers2

2

uWSGI will warns you whenever you run it as root. Independently by the usage (it is perfectly fine to run the emperor as root to allow vassals to be mapped to different uid), you will get the warning. Users must be conscious when they run root processes.

roberto
  • 1,827
  • 12
  • 8
1

You could ignore it, however, for best practice you should specify running user.

uwsgi --emperor /path/to/vassels/* --uid www-data --gid www-data 

It's complaining that the emperor process is running as root. Now, while this doesn't serve any requests, it could be a potential problem. Each of the vassels will have the configuration you've specified.

It's always advisable if at all possible to run a process isolated.

pobk
  • 275
  • 1
  • 7
  • If it is a best practice that emperor should not run as root, why does the documentation disagree? "The emperor is normally run as root, setting the UID and GID in each instance’s config." https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html – dsadinoff Sep 03 '17 at 06:58