On Wed, Oct 24, 2012 at 08:16:00AM +0200, Roberto De Ioris wrote: > > > On Wed, Oct 24, 2012 at 05:47:12AM +0200, Roberto De Ioris wrote: > >> Sadly there is no way to override the paths in "tmpfile()", but as you > >> have root access you can bind mount /tmp in another "place": > > > > You might want to avoid tmpfile for this and other reasons. > > The BSD implementation is quite heavy since it has to block signals to > > provide the atomicity criterions of tmp_file for example. > > > > I think what would be the most reasonable approach is creating one > > temporary directory in the master using mkdtemp and using the PID of the > > worker + per-worker counter as file name. That means two system calls > > are needed (open + unlink) and the location can be easily configured. > > > > Joerg > > > Maybe we do not even need mkdtemp, as we can uniquely identify a request by > pid+core: > > /* BASE could be TMPDIR or a configurable path xxxxx is the pid yyyyy is > the core > */ > filename = 'BASE/uWSGI_postbuf_xxxxx_yyyyy'; > fd = open(filename, O_RDWR|O_CREAT....); > unlink(filename);
mkdtemp has the advantage that you don't have to worry about race conditions and symlink attacks and so on. Joerg _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
