Bug 192956 - uwsgi can't set uwsgi_uid/uwsgi_gid to 0 in rc.conf
Summary: uwsgi can't set uwsgi_uid/uwsgi_gid to 0 in rc.conf
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-23 22:56 UTC by Luca Corti
Modified: 2018-01-10 08:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Corti 2014-08-23 22:56:03 UTC
If I set uwsgi_uid/uwsgi_gid  to 0 in /etc/rc.conf:

uwsgi_uid="0"
uwsgi_gif="0"

and run uwsgi I get:

$ service uwsgi restart
/etc/rc.conf: uwsgi_uid: not found
/etc/rc.conf: uwsgi_gid: not found
/etc/rc.conf: uwsgi_uid: not found
/etc/rc.conf: uwsgi_gid: not found
Stopping uwsgi.
Waiting for PIDS: 44668.
Starting uwsgi.

But root is required to run in emperor mode.
Comment 1 John Marino freebsd_committer freebsd_triage 2014-08-24 08:31:07 UTC
(In reply to Luca Corti from comment #0)
> If I set uwsgi_uid/uwsgi_gid  to 0 in /etc/rc.conf:
> 
> uwsgi_uid="0"
> uwsgi_gif="0"


"uwsgi_gif" ?

Is that literally what you have in make.conf or did you make a typo here?
Comment 2 Luca Corti 2014-08-24 10:27:22 UTC
No, thats a typo I have:

uwsgi_enable="YES"
uwsgi_flags="--emperor /usr/local/etc/uwsgi/vassals --emperor-tyrant"
uwsgi_uid = "0"
uwsgi_gid = "0"
Comment 3 John Marino freebsd_committer freebsd_triage 2014-08-24 10:49:35 UTC
over to maintainer
Comment 4 Daniel Austin 2014-08-24 10:51:44 UTC
You shouldn't have spaces around your "=" in /etc/rc.conf
If you remove those spaces, the variable assignments will work properly.

uwsgi_uid = "0"
uwsgi_gid = "0"

becomes:

uwsgi_uid="0"
uwsgi_gid="0"
Comment 5 Luca Corti 2014-08-24 11:12:25 UTC
Indeed, I changed it to:

uwsgi_uid="root"
uwsgi_gid="wheel"

because

uwsgi_uid="0"
uwsgi_gid="0"

doesn't work. uwsgi logs

group 0 not found.

Also, with my current config, service uwsgi stop does not stop uwsgi:

uwsgi_enable="YES"
uwsgi_flags="--emperor /usr/local/etc/uwsgi/vassals --emperor-tyrant"
uwsgi_uid = "root"
uwsgi_gid = "wheel"
Comment 6 Walter Schwarzenfeld freebsd_triage 2018-01-10 08:49:28 UTC
uwsgi is working without problems. And I think this is overcome by time and events, and as reply since
over two years, probably solved and can be closed.