I have following uwsgi.ini
:
[uwsgi]
uid = myuser
gid = myuser
master = true
daemonize = /path-to-log/uwsgi.log
...
I run uwsgi in rc.local
. I can see workers run as myuser
, I can see uwsgi switches to myuser
in log and I'm assuming myuser
will also be owner of uwsgi.log
. But root
is owner of uwsgi.log
.
How could I set owner of uwsgi.log
? It's for convenience – I'd like to see log without sudo.
Best Answer
(from
uwsgi --help
):--logto2
(log to specified file or udp address after privileges drop)(or the similar
--daemonize2
if you want to daemonize)alternatively
--logfile-chown
(chown logfiles)Finally remember you can call custom functions at the various server stages:
http://uwsgi-docs.readthedocs.org/en/latest/Hooks.html