Previous releases came with a simple script that went in init.d, and allowed
JBoss to run as a service with a small amount of tweaking. A ruby based
approach seems overkill to me...
-----Original Message-----
From: jboss-as7-dev-bounces(a)lists.jboss.org
[mailto:jboss-as7-dev-bounces@lists.jboss.org] On Behalf Of Andrew Lee
Rubinger
Sent: 18 May 2011 19:41
To: jboss-as7-dev(a)lists.jboss.org
Subject: [jboss-as7-dev] Linux Service Control for AS
This email from Dan Allen yesterday:
---------------
One of the *huge* pains for sys admins assuming control of JBoss AS for
the first time is getting it setup as a system service. We provide this
for our EAP RPMs of course, but we just about annoy the crap out of
system admins and accidental developer admins struggling with
this seemingly simple task.
But no more!
Since one of the main themes of AS 7 is "admin-friendly", then we should
definitely recommend this dead simple recipe for setting up JBoss AS as
an upstart service. The Torquebox guys show how to do this with AS 6
(which is part of the Torquebox distribution).
http://torquebox.org/news/2011/05/11/simplify-your-deployment/
which was inspired by the original article by Heroku
http://adam.heroku.com/past/2011/5/9/applying_the_unix_process_model_to_web_
apps/
The recipe involves running foreman on a Procfile. foreman is a ruby
gem. But actually, foreman is really just a means to an end. In the end,
you are just creating three files in /etc/init that look like this:
*/etc/init/jboss-as.conf*
pre-start script
bash << "EOF"
mkdir -p /var/log/jboss-as
chown -R dallen /var/log/jboss-as
EOF
end script
*/etc/init/jboss-as-default-1.conf*
start on starting jboss-as-default
stop on stopping jboss-as-default
respawn
chdir /home/dallen/opt/jboss-as
exec su dallen -c 'export PORT=5000; ./bin/run.sh >>
/var/log/jboss-as/default-1.log 2>&1'
*/etc/init/jboss-as-default.conf*
start on starting jboss-as
stop on stopping jboss-as
The it's just:
start jboss-as
and
stop jboss-as
Ahhhhhh.
We should definitely include this in the AS documentation (both for AS 6
and AS 7). You can't imagine how many hours this is going to save admins.
_______________________________________________
jboss-as7-dev mailing list
jboss-as7-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev