13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

20.5 Things That Make It Go459runlevel is overwritten by whatever you specify. There is more to this; see themanpage for chkc<strong>on</strong>fig for details.Now, before we put JBoss under management, we need to make a scriptfor it. Or rather, we need to modify the <strong>on</strong>e provided by JBoss. In the binsubdirectory of JBoss, you will find a script called jboss_init_redhat.sh.You will notice that it has the “chkc<strong>on</strong>fig mojo” in it—that is, the“chkc<strong>on</strong>fig:” comment line. We menti<strong>on</strong>ed this in passing when we lookedat the atd init script, but we didn’t tell you what those three numbers after thecol<strong>on</strong> actually mean. The first is the list of runlevels in which you want theprogram to run. The sec<strong>on</strong>d is the start priority, which is the number that willfollow the S in the rcX.d runlevel symlink directory. The third number is thestop priority, which is the number that will follow the K in the rcX.d runlevelsymlink directory.These start and stop priority numbers can be very important indeed. Someservices (like NFS) depend up<strong>on</strong> others (like portmap). Your JBoss server mightdepend <strong>on</strong> a service like mysqld or postgresql. D<strong>on</strong>’t toy with these orderslightly. You can seriously mess up your services if you d<strong>on</strong>’t know what you aredoing. Still, you will probably have to tweak things to get them completelyright. Just be cautious and think about every change.Example 20.4 is the script as it comes with JBoss 3.2.3.There are three things we have to change here. The first are the runlevelsin the “chkc<strong>on</strong>fig:” line (we’ll show you the changed lines with a couple oflines of c<strong>on</strong>text):## chkc<strong>on</strong>fig: 345 80 20# descripti<strong>on</strong>: JBoss EJB C<strong>on</strong>tainer#Next, we may need to change the paths to JBoss and to the Java runtime.In our case, if you installed into /usr/local and created the symbolic link aswe suggested, you d<strong>on</strong>’t need to change the JBOSS_HOME, but you have tochange the JAVAPTH variable: 1414. We are assuming you have set up your Java SDK as described in Chapter 6. If your java*commands are located somewhere else, change this path to point at them.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!