java on RH AS 3.0?

Ryan Golhar golharam at umdnj.edu
Wed Sep 8 17:45:55 UTC 2004


Hi Reuben,

I had the exact same question.  Here is a message from the archives that
answered my question.  But you still make a good point, the replacement
/usr/bin/java shell script is pointless.

the alternatives system is there to allow you to install several 
services/packages that provide the same functionailty ( and very often
the 
same program names) and switch between them without uninstalling either.
Its most common use is to switch between sendmail and postfix, but links
can 
be set up to cater for any package at all.
How does it work?
okay, the postfix/sendmail example:
many programs look for a 'sendmail' binary when they want to, well, send
mail. unfortunately both  the sendmail and postfix packages normally
provide a 
binary of this name, which means that if you want to switch from
sendmail to 
postfix you would normally have to uninstall sendmail and then install

postfix instead, which will involve at the very least a certain amount
of 
downtime. On a Redhat system, these packages have been 'hacked' to
provide 
sendmail.sendmail / sendmail.postfix (among other) binaries, so that
this 
problem no longer exists, but how do apps know which one to call? a
series of symbolic links are set up: /usr/sbin/sendmail ->
/etc/alternatives/mta -> /usr/sbin/sendmail.postfix why three links
instead of two? well, the other programs with clashing names also have
to be dealt with, This 
is done using a series of 'slave' links which are automtically switched
over 
when you change the master 'mta' link.
try the alternatives command:
[root at behemoth root]# alternatives --display mta
mta - status is manual.
 link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.sendmail - priority 90  slave mta-pam:
/etc/pam.d/smtp.sendmail  slave mta-mailq: /usr/bin/mailq.sendmail slave
mta-newaliases: /usr/bin/newaliases.sendmail  slave mta-rmail:
/usr/bin/rmail.sendmail  slave mta-rsmtp: (null)  slave mta-runq:
(null)
slave mta-sendmail: /usr/lib/sendmail.sendmail  slave mta-mailqman:
/usr/share/man/man1/mailq.sendmail.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
 slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
/usr/sbin/sendmail.postfix - priority 30
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-rsmtp: (null)
 slave mta-runq: (null)
 slave mta-sendmail: (null)
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.sendmail.

you switch between the two systems with 
alternatives --set mta /usr/sbin/sendmail.sendmail
(or postfix or any other that you have set up this way)
or by using 
redhat-switch-mail
wich will change the master link and the slaves will follow along like
sheep.

any help?
ps if you want to know the command that set these things up, look at the

install scripts for sendmail

rpm -qp --scripts sendmail

-----
Ryan Golhar
Computational Biologist
The Informatics Institute at
The University of Medicine & Dentistry of NJ

Phone: 973-972-5034
Fax: 973-972-7412
Email: golharam at umdnj.edu

-----Original Message-----
From: Reuben D. Budiardja [mailto:techlist at voyager.phys.utk.edu] 
Sent: Wednesday, September 08, 2004 12:55 PM
To: golharam at umdnj.edu; General Red Hat Linux discussion list
Subject: Re: java on RH AS 3.0?


On Wednesday 08 September 2004 11:02, Ryan Golhar wrote:
> How do you uninstall the libgcj package?  I tried doing that initially

> but found libgcj is required by other RPMs which in turn are required 
> by others as well...

And I still don't understand what the heck is the link /usr/bin/java, 
/usr/bin/javac provided by the libgcj supposed to do. I mean, I read
about 
the /etc/alternatives stuffs and what it supposes to do, but in all 
practicality, the command java and javac from Redhat do nothing. How is
it 
suppose to work? could someone explain ? 

(BTW, I also just removed the symlink so my PATH would pick up my own
Sun's 
JDK install).

Thanks.

RDB 

-- 
Reuben D. Budiardja
Dept. Physics and Astronomy
University of Tennesse, Knoxville, TN

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT/M/MU/P/S d-(++) s: a-- C++(+++) UL++++ P-- L+++>++++ E- W+++ 
N+ o? K- w--- !O M- V? !PS !PE Y PGP- t+ 5 X R- tv+
b++>+++ DI D(+) G e++>++++ h+(*) r++ y->++++
------END GEEK CODE BLOCK------





More information about the redhat-list mailing list