Previous versions of JBoss included a scripts (like jboss_init_redhat.sh
) that could be copied to /etc/init.d in order to add it as a service - so it would start on boot up. I can't seem to find any similar scripts in JBoss 7. Has anyone already done something like this?
P.S. I'm trying to achieve this in Ubuntu 10.04
I found no solution here which were really working... (at least for Ubuntu 12.04 LTS)
So I made my own one (which is able to start JBoss & wait for it to complete, and stop it, using the
start-stop-daemon
utils) :One can change the
JBOSS_CONF
variable near the top of the file as well as removing it if thejboss-as.conf
file is located at/etc/default/jboss-as-7
.I also took a shot at a script for Ubuntu 10.04 LTS. JBoss version is 7.1.1. I wanted a script that really tests for successful JBoss startup and that is able to shut down JBoss relatively gracefully. My starting point was the JBoss script included in the bin/init.d directory in the JBoss 7.1.1 download. I adapted this with some bits from other scripts on this page as well as other Ubuntu init scripts. Note that Ubuntu uses dash as its default init-script interpreter, not bash as apparently expected by the JBoss script. Of medium importance is that the logging takes place in
/var/log/jboss-as
instead of${JBOSS_HOME}/standalone/log
. The log is also used to determine if JBoss started up successfully.jboss-as-standalone.sh
And the accompanying configuration (put it in /etc/default/jboss-as ):
What works (commands, use
sudo service jboss-as <command>
after linking the script from/etc/init.d/jboss-as
):What isn't tested:
I didn't dive into several topics yet, especially:
Note that I'm definitely no shell script guru - I'm rather quite clueless. So if you find any stupidisms in the code or got any ideas for improvements, I'd be glad to hear them.
Watch under bin directory you have init.d/jboss-as-standalone.sh (jboss-as-7.1.0.CR1b)
To print PID of command executed use shell variable $!. This variable will print PID of process executed.
Just been fighting through this tonight, and thought I'd share my findings. In the end i followed the install instructions here: http://ptoconnor.wordpress.com/2012/11/19/jboss-as-7-1-1-on-an-ubuntu-12-04-aws-instance-running-oracle-java-7/ with some alterations;
I installed to /usr/share not /opt
To get jboss to run as a service, i created a symbolic link to the redhat/centos friendly /usr/share/jboss-as-7.1.1.Final/bin/init.d/jboss-as-standalone.sh which was provided with the 7.1.1 final release
then a few changes to make it ubuntu friendly
now it's just a case of installing the jboss service using the above script.
I know there are lots of variations now, but hopefully this will help the next person searching. All i wanted was a JBPM host ...