I'm not really familiar with the scripts to which you refer. However, the jboss.pid is a manufactured file as starting JBoss does not actually cause this file to be created. Most likely, the script looks for the pid reported in a ps ax | .. and stores that to file. Since JBoss takes a while to bootstrap in most cases, the existence of a PID file is not a guarantee that sometime after the file is created that the bootstrap did not fail. Similarly, the standard shutdown command communicates with the JBoss server to signal a shutdown and pays no attention to the pid file. Most likely, the wrapper script you wrote just checks that the pid has disappeared after the shutdown signal, and deleted the pid file.
I would look at server/instance/log/server.log and see if it successfully started (and you should see all the things JBoss does as it bootstraps). There should be a line with ".. Completed in .." telling you how long it took JBoss to bootstrap. If not, start checking back through and try to determine the problem. If there is no output (check date/time stamps), then probably the shell script did not start JBoss.
Sanne is currently working on an operations manual that will have a working init.d script but I'm not sure how long it will take to complete the document. I've also posted a raw script in this forum - it requires work but should be an ok starting point for someone reasonable with shell scripts.
Hi jonlee and others,
There are two scripts on pp 21+ of the free downloadable "JBoss Getting Started" on jboss.org web site. That's where my ? come from. I have worked some of my issues out but referring to the script called "go.sh" in the book there is a reference to the varialbe JBOSS_OPTS. Presumably this refers to jboss options but I cannot find any references to it.
It would be great if there was a well written init.d script to run jboss as a daemon.
Thanks for your 1st response.
I must admit that I ignore the free guide as it is dated and some things just no longer apply.
There is nothing overly special about starting JBoss, at least not on RedHat 7.2. I can't imagine that much has changed in RedHat 9.
The core for starting JBoss in a root initiated script should be something along the lines of:
su -p -s /bin/sh -c "./run.sh 2>&1 >run.log &" apache
Any customizations can be made in the run.sh. For example, setting your JAVA_OPTS to reflect any special JVM settings such as -Xrs and similar.
I attach a rudimentary jboss init.d script that works for RedHat 7.2. I'm sure it could be improved but it works.