> Pier,
>
> I took a quick look at the code and found the RegisterNative function.
This
> looks like an interesting feature. I also found the same function in your
> daemons code. The picture is becoming much clearer.
>
> Let me try to get it working in the next few days with the callback
function set
> to invoke setuid() and have the callback invoke (via Java reflection since
it
> won't be there on Windows or standalone start.
>
> If I can get this to work, I will post the patches first so that all can
> inspect. Now that I understand this approach, it basically seems to work
through
> the same logical steps (from a Tomcat Java code) perspective as invoking
the
> callback function via JNI.
>
> In your approach, the function is preloaded for Java (no
System.loadLibrary()
> required) and the Java code invokes the function like any other method (it
just
> happens that the method doesn't exist at compile time but only at
runtime).

There are only two "native daemon" configurations I'm interested in:
- embedded in Apache 2 with a JNI connector
- used through jsvc on Unix, and some similar wrapper on Win NT (or jsvc.exe
using Cygwin; it works :))

With Daemon, from the C code, all you have to do is, as Pier pointed out:
- Call init
- Use setuid to downgrade to nobody
- Call start
- Wait for a stop signal, at which point you call stop

At this point, I do not see the need for any use of native code from the
Java side.

Remy


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to