dcsimg
Spawning a UNIX process from a Servlet via JNI
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ajay_Vaishampayan
Posted On:   Tuesday, September 3, 2002 08:59 PM

Here's our application.




1. A Servlet running under weblogic makes a JNI call (spawn_server) that does the following:


a. Does a fork


b. In the child process does an exec of 'X'.



Our problem :




The PPID (Parent Process ID) of 'X' is WEBLOGIC. We would like it to be 1.




Is there any way to accompish this ?

Re: Spawning a UNIX process from a Servlet via JNI

Posted By:   Laurent_Mihalkovic  
Posted On:   Thursday, September 5, 2002 01:32 AM

have you considered using a slightly modified design, and for example have your servlet open a socket that would be monitored by the inetd daemon. inetd would be configured to launch your daemon upon invocation.

just a thought
laurent

Re: Spawning a UNIX process from a Servlet via JNI

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, September 4, 2002 08:22 AM

The PPID (Parent Process ID) of 'X' is WEBLOGIC. We would like it to be 1.



The pid "1" is for the "init" process, the first one that comes up when the system starts. Anything with "1" as the parent would have to be something spawned directly from init.



You ARe talking about the pid and not the uid, right? because that's a different issue (you would have to run something setuid, to change its uid, and deal with possible security implications).

About | Sitemap | Contact