Comment 2 for bug 1712463

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote : Re: taskflow not running under wsgi configuration

We're using oslo_concurrency.processutils to call qemu-img ; want to use the process limits facility that gives us because of a security issue (bug #1449062).

When you call processutils.execute() with a prlimit argument, it uses sys.executable to get the python interpreter to make the call with [0] and then passes -m oslo_concurrency.prlimit --as=1073741824 --cpu=2 --' before the command.

In the screen-based devstack, sys.executable was /usr/bin/python and everything worked.
In the systemd-based devstack, sys.executable is /usr/local/bin/uwsgi, which doesn't understand the arguments and thinks it's being passed a config file.

From the command line:
$ /usr/local/bin/uwsgi -m oslo_concurrency.prlimit --as=1073741824 --cpu=2 -- qemu-img info --output=json file:///tmp/glance_workdir/a4a3a99e-6ba3-4e7a-96d9-1b01f0bc097e
output:
unable to load configuration from oslo_concurrency.prlimit

$ /usr/bin/python -m oslo_concurrency.prlimit --as=1073741824 --cpu=2 -- qemu-img info --output=json file:///tmp/glance_workdir/a4a3a99e-6ba3-4e7a-96d9-1b01f0bc097e
output:
{
"virtual-size": 1265664,
"filename": "///tmp/glance_workdir/a4a3a99e-6ba3-4e7a-96d9-1b01f0bc097e",
"format": "raw",
"actual-size": 1265664,
"dirty-flag": false
}

[0] https://github.com/openstack/oslo.concurrency/blob/aeaee20c8db756e66f59285520a4e5cacdb740f2/oslo_concurrency/processutils.py#L353