Java Reference
In-Depth Information
Example 20.5
Using
chkconfig
to include JBoss start script
[root@cvs root]# cd /usr/local/jboss/bin
[root@cvs bin]# cp jboss_init_redhat.sh /etc/init.d/jboss
[root@cvs bin]# chkconfig --add jboss
[root@cvs bin]# chkconfig --list jboss
jboss 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@cvs bin]# /etc/init.d/jboss start
CMD_START = cd /usr/local/jboss/bin; /usr/local/jboss/bin/run.sh -c default
and
/etc/shadow
after you create the user. Unfortunately, the JBoss program
needs to run a shell script, so you cannot set the shell to
/sbin/nologin
as is
usual. Set the password for the user in
/etc/shadow
to
x
, which is completely
invalid and will forbid login to the account by password.
Finally, you will need to add the user
jboss
to any groups you created for
JBoss management (such as
local
in our case). Truth be told, it would be a
good idea to use the
jboss
user to install JBoss. It will avoid having to deal
with some file ownership and permission issues. If you do not do this, the
simplest way to get this init script working (you will get permission errors) is
to run
chmod -R g+w /usr/local/jboss
That will make the script work with the
jboss
user, provided
jboss
be-
longs to the group owner of the JBoss installation.
The final step is to copy your modified script to its final destination and
run
chkconfig
to install it in all the runlevels (Example 20.5).
You now have JBoss running. You can start and stop it with the script,
and it will come up and shut down automatically depending on the runlevel
you switch to. Beauty, eh?
20.5.3
You don't need
chkconfig
to set up equivalent scripts. In fact, the same script
provided by JBoss for RedHat will work with most distributions that use Sys-
tem V init system. You will have to copy the init script and then create the
appropriate symlinks manually, or locate the automated setup tools for your
particular distribution (Debian, for example, has many such tools which you
select with their package management system).
Other Distributions