>> - first of all, the for(;;) endless loop for starting a namespace is too >> aggressive. If there's any error in the namespaced child, it'll take >> 100% of a cpu. Some kind of backoff would be required here (although >> that comes close to an implementation of an init system) > > The only thing coming to my mind is having a sleeping system (similar to > anti-fork-bombing in the master) where the more errors appear the more > sleep time will be used. Other ideas ?
That seems good enough. >> - the second problem is that uwsgi first unmounts all the mount points, >> and if the wanted ns root is on a separate filesystem (say /home) it'll >> get unmounted, before it's bind mounted on ns_tmp_mountpoint. >> (a chdir(uwsgi.ns) before unmount all, helps) > > this will leave the original /home mounted in the jail or am i missing > something ? I think it should be reorganized a bit. Maybe, move the unmounting after the pivot_root. you remount /proc explicitly and the namespace root will stay mounted. I will try to find how other projects do this dance. >> - since uwsgi is started from some other filesystem/mount point, that >> mount point will not be unmounted, so the child will keep a reference to >> the master namespace allowing it to exploit it (although there are some >> precautions against that, still). One thing that's possible is a *read >> only* bind mount of the uwsgi executable inside the child root, and >> re-execing the child from there. > > > wow, i did not know that MS_BIND could be applied to file too. This is > very useful. you can, try „touch file; mount --bind /some/path/other/file file“ unfortunately I just tried it and the read only option is not honored, so it will get RW mounted. Thanks. -- damjan _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
