On Wed, 15 Nov 2000, Francisco Gongora wrote:

> Hello:
> 
> We want our application to start automatically at boot, or stop when the
> system shuts down.  We are using a startup script ( /etc/rc.d/init.d ) for
> that.  After we start the java application (jar), we cannot find the name of
> the process (process id).  The name of the command in the process table is
> "java" regardless how many java applications are running at the same time.
> Trying to get the process id using: ps -ef | grep classname, will return
> nothing.
> 
> How can I get the name of a process (java application) to be able to kill
> it?
> Is there any other way to run the application automatically when the machine
> boots up?
> 
> We will appreciate any help with that.  Thanks.

Possibilities:  If your shell is bash, and if you're launching the jvm
as  background process, see if you can use $! to retrieve the PID of the most
recently launched background process.

See if your 'ps' has a -f option that lists the parameters to the processes.
This parameter list can then be grepped for the name of your jar file.

Investigate your API to see if the toolkit can return the PID of the jvm
anywhere.  I don't know if there is one.  If not, a JNI method may be 
useful here.  Once your code knows its PID, write it to a file.


-- 
Joi Ellis                    Software Engineer
Aravox Technologies          [EMAIL PROTECTED], [EMAIL PROTECTED]

No matter what we think of Linux versus FreeBSD, etc., the one thing I
really like about Linux is that it has Microsoft worried.  Anything
that kicks a monopoly in the pants has got to be good for something.
           - Chris Johnson


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to