On Sat, 10 Feb 2001, you wrote:
> Tom Cook wrote:
>
> > On Thu, 08 Feb 2001, you wrote:
> > > Greetings,
> > [snip]
> > > Toby suggested using $! to capture the PID of the Java process launched in the
> > > background. While I dont think this will work in the init.d/jboss script it will
> > > work by adding it to $JBOSS_HOME/bin/run.sh , if that script is run in the
> > > background.
> >
> > And if you run the java command in the background... otherwise you won't get
> > the PID until the process finishes, when it won't be much use to you.
> >
>
> Tom,
> Im' incorporating your suggestions ( kill -9 --> kill -15, backticks ...), but I
> wanted to make a comment about this last remark.
>
> When run.sh starts in the background, you get the following branch of the ps tree
>
> #pstree |grep java
> |-java---java---19*[java]
>
> (thats for IBM, with Blackdown or Sun there are 23 at the end)
> and it is this first java process who's pid is captured by $! , which seems
> to work just fine. So It might be enough to just run run.sh in the background.
Think about it... if you have this in run.sh:
1 CP=...
2 java -classpath $CP org.jboss.Main
3 echo $! > /path/to/jboss.pid
then line 3 won't be executed until line 2 has completed... that is, until
jboss has exited, so you need to run java in the background, or you won't have
the PID until it's past time to use it, even if you have run.sh in the
background.
Tom
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]