>> But I've got problem with putenv/getenv calls, which didn't >> appears to works (did there is a problem if we want to >> putenv() from inside a process ?). > >Yes, most of the times it is. I don't know exactly why, it may >depend on the VM ( because I got it to work with some VMs ).
Not only with VM, you does a putenv() at some part of the code, a following getenv() show the var, but when you redo getenv() later (ie in replaceProperties), you get null (and it's the same pid and threadid...) >Setting the env before starting the process seems the best solution. >( I suspect LD_LIBRARY_PATH is used by ld.so before the process >starts, and changes are not picked up ). LD_LIBRARY_PATH is mandatory before app launch >Or it may be something else - but even if we get it to work on >linux, there are many other platforms where it may brake. > >> > >> > void init() { >> > apr.setUser(); >> > } >> >} >> > >> >It's more flexible. >> >> Did you plan to add setUser calls ? > > >Eventually. I'm a bit tired right now, I spent 2 days building and >finding dependencies. If you have some time... > > >> >I think late - to make sure logs and other resources can be >acquired ( >> >port 80, etc ). >> >> Hum, so jni/java could get root protected resources ? >> I didn't understand well here, since jni/vm is launched by a child >> and apache2 child are no more root, (only main process stay root) >> so they couldn't get access to resource (and that's why I've got >> problem with shm access, which was created by the main process which >> is root). > >That's a tricky one. Of course, the quick workaround is to change >permissions. I'm curious what would happen if we start the VM >in _parent_, >before forking. We can then get access to root-protected >resources, fork, >than hope it'll work. > >I never tried fork from a JVM. Interesting... > >But except in-process, I think tomcat should first acquire the >resources >it needs and then call setUser(). I still have to figure when parent and when childs call modules funcs -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>