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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

458Chapter 20Open Source Web <str<strong>on</strong>g>Applicati<strong>on</strong></str<strong>on</strong>g> Serversappropriate symlinks to the rcX.d directories. 13 So, first we have to take aninit script and modify it to run JBoss.20.5.2 RedHat/Fedora chkc<strong>on</strong>figRedHat and its stepchild, Fedora, use a program called chkc<strong>on</strong>fig to automatethe setup and integrati<strong>on</strong> of init scripts.The chkc<strong>on</strong>fig program has four basic functi<strong>on</strong>s. Two involve adding andremoving services from management. That’s our main interest here, but we’llget to that in a moment. The other two involve querying and setting the runlevelsin which services run. That is the more comm<strong>on</strong> use, so we’ll look atthose first.[root@host238 root]# chkc<strong>on</strong>fig --list ntpdntpd 0:off 1:off 2:off 3:<strong>on</strong> 4:off 5:<strong>on</strong> 6:offTIPchkc<strong>on</strong>fig --list without specifying a service name will list all the servicesmanaged by chkc<strong>on</strong>fig, including those that are provided by xinetd, which wewill not cover here.As you can see, ntpd runs at runlevels 3 and 5, and does not run at anyothers. The --list argument lets you query the runlevels.[root@host238 root]# chkc<strong>on</strong>fig --levels 2345 ntpd <strong>on</strong>[root@host238 root]# chkc<strong>on</strong>fig --list ntpdntpd 0:off 1:off 2:<strong>on</strong> 3:<strong>on</strong> 4:<strong>on</strong> 5:<strong>on</strong> 6:offThe --levels argument lets you specify a list of runlevels that will applyto the named service. The last argument may be <strong>on</strong> or off to specify whichsetting to apply to those runlevels. The current value (<strong>on</strong> or off) for a specified13. Just a quick reminder that not all <strong>Linux</strong> distributi<strong>on</strong>s name their directories or scripts inprecisely the same way, but they all use something similar. By examining the /etc/inittabfile and the c<strong>on</strong>tents of the /etc directory, you should be able to figure out the details of anygiven distributi<strong>on</strong>. Over time, more and more distributi<strong>on</strong>s have come to exactly match thenaming scheme described here. RedHat, Fedora, and Debian, for example, all follow thisnaming scheme.

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

Saved successfully!

Ooh no, something went wrong!