In the shell script, you can get the process id of the process last started IN
THE BACKGROUND.
It is a shell variable.
In ksh the variable is $!.
The idea is to write this value into a file associated with your application.
Something like:

java myclass &
echo $! > myclass.pid

Now the file myclass.pid has the pid of the java process.

Hope this helps,
Mike


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.
>
> Francisco
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


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

Reply via email to