cancel
Showing results for 
Search instead for 
Did you mean: 

softlink problem

SOLVED
Go to solution
Donald Thaler
Super Advisor

softlink problem

i thought i posted this before but i don't see it so i apologize in advance if it winds up displaying twice...

i have a soft link:
ls -l /usr/bin/cc
lr-xr-xr-x 1 root sys 15 Apr 21 14:02 /usr/bin/cc -> /opt/aCC/bin/cc

this should be linked to /opt/aCC/bin/aCC per oracle...

oracle support suggested i do the following:
(1) mv /opt/aCC/bin/cc /opt/aCC/bin/cc_org

(2) ln -s /usr/bin/cc /opt/aCC/bin/aCC ..

when i do this i get this error:
ln: /opt/aCC/bin/aCC exists

when i do another:
ls -l /usr/bin/cc
lr-xr-xr-x 1 root sys 15 Apr 21 14:02 /usr/bin/cc -> /opt/aCC/bin/cc

.. this is fairly confusing to me... if i did the "mv /opt/aCC/bin/cc /opt/aCC/bin/cc_org" which i assume is supposed to move the softlink, why is it still showing when i do an
ls - /usr/bin/cc... and why do i get the "already exists" error when executing
ln -s /usr/bin/cc /opt/aCC/bin/aCC ...

better yet what do i have to do the get the softlink /usr/bin/cc to point to /opt/aCC/bin/aCC ????












# mv /opt/aCC/bin/cc /opt/aCC/bin/cc_org
# ln -s /usr/bin/cc /opt/aCC/bin/aCC
ln: /opt/aCC/bin/aCC exists
# ls -l /usr/bin/cc
lr-xr-xr-x 1 root sys 15 Apr 21 14:02 /usr/bin/cc -> /opt/aCC/bin/cc
# ls -l /opt/aCC/bin/cc_org
-r-xr-xr-x 1 bin bin 985208 Jun 22 2007 /opt/aCC/bin/cc_org

14 REPLIES
Patrick Wallek
Honored Contributor
Solution

Re: softlink problem

You are confusing moving the link and moving the real executable.

Your command "mv /opt/aCC/bin/cc /opt/aCC/bin/cc_org" is moving the ORIGINAL executable and is NOT touching the link.

/usr/bin/cc is the soft link which is pointing to /opt/aCC/bin/cc.

The instructions from Oracle are backwards!

You need to do:

# rm /usr/bin/cc
# ln -s /opt/aCC/bin/aCC /usr/bin/cc
# ls -l /usr/bin/cc

This should now point to /opt/aCC/bin/aCC.
Bijeesh
Respected Contributor

Re: softlink problem

hi
if you need to create soft link /usr/bin/cc which points to /opt/aCC/bin/aCC ,the step (2) will be #ln -s /opt/aCC/bin/aCC /usr/bin/cc

Michael Mike Reaser
Valued Contributor

Re: softlink problem

You've got your filenames backwards on the "ln" command. The first file is the permanent one to which the link is to point (in your case, /opt/aCC/bin/aCC) while the second name is the link which is to be created (in your case, /usr/bin/cc).

Try using

# mv /opt/aCC/bin/cc /opt/aCC/bin/cc_org
# rm /usr/bin/cc
# ln -s /opt/aCC/bin/aCC /usr/bin/cc

Now when you do your "ls -l /usr/bin/cc" you should see Happy Information Listed. :-)
There's no place like 127.0.0.1

HP-Server-Literate since 1979
Steven E. Protter
Exalted Contributor

Re: softlink problem

Shalom,

Soft Links work IMO in a counter intuitive way.

To get it right and I frequently get the same error.

I cd to the directory I want the soft link

link -s path_to_executable localname

example

link -s /usr/bin/perl perl5

This saves me the trouble of saving my perl scripts and making changes when I migrate them from Linux to HP-UX

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: softlink problem

>this should be linked to /opt/aCC/bin/aCC per oracle.

Oracle is incorrect. cc must link to cc. Do NOT touch this symlink!
(What problem are you trying to solve?)

>Patrick: The instructions from Oracle are backwards!

Not just backwards but incorrect.

Armin Kunaschik
Esteemed Contributor

Re: softlink problem

I agree with Dennis... you should not touch the Compiler installation, regardless what Oracle says. Make sure that cc always points to the location the OS wants to it to point. E.g. the kernel configuration of HP-UX 11.11 relies on that.
Use swverify to check that everything is OK.

Second thing was already mentions: The support guy mixed source and destination... luckily he did not ask you to use the -f switch.

My 2 cents,
Armin
And now for something completely different...
Dennis Handly
Acclaimed Contributor

Re: softlink problem

>Armin: Make sure that cc always points to the location the OS wants to it to point.

Actually it has nothing to do with the OS, just the HP C/aC++ compiler. I.e. where I want it to point. ;-)

>E.g. the kernel configuration of HP-UX 11.11 relies on that.

I thought 11.11 uses cc_bundled(1)? And this case is at least 11.23.
Sajjad Sahir
Honored Contributor

Re: softlink problem



Dear Donald

regarding software link please read this and above thread also, because i don't want to mention the same thing again

In Unix, a file that points to another file or directory. It is used to allow a variety of sources to point to a common destination. The Windows 2000 counterpart is the "virtual directory." When URLs are redirected, it is called "URL mapping." A symbolic link is like a Windows shortcut, except that the link is an index entry in the Unix file system, whereas the shortcut is a regular Windows file.

Donald Thaler
Super Advisor

Re: softlink problem

Dennis...

when installing an oracle patch or when trying to install a new oracle home i'm getting linking errors which oracle's doc-id 387101.1 was caused by the softlink /usr/bin/cc pointing to /opt/aCC/bin/cc instead of /opt/aCC/bin/aCC..

but chaning the softlink didn't help the problem... are you suggesting i set the softlink back to what it was originally ?

right now this is a priority 1 service request with oracle since they originally told me i needed to get the hp bundles up to date and that the linker problem would probably be fxed when i did that. they were wrong. this is the type of error i'm getting when trying to install a patch:
Make failed to invoke "/usr/ccs/bin/make -f ins_rdbms.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/10.2.0"....'genclntsh: Failed to link libclntsh.so.10.1... have you run across a similiar problem ??
Dennis Handly
Acclaimed Contributor

Re: softlink problem

>I'm getting linking errors which oracle's doc-id 387101.1 was caused by the softlink /usr/bin/cc pointing to /opt/aCC/bin/cc instead of /opt/aCC/bin/aCC.

This is broken, this isn't the cause. If there is a linking error, Oracle should change their use of cc to aCC, not fiddle with the aC++ installation. (Not sure if this is the cause but if you are linking aC++ applications, you must use aCC and not cc.)

>but changing the softlink didn't help the problem. are you suggesting I set the softlink back to what it was originally?

It if doesn't help, there is no need to change it. And yes, you must put it back.

>right now this is a priority 1 service request with oracle since they originally told me I needed to get the hp bundles up to date and that the linker problem would probably be fixed when i did that.

What type of linking problem, unsats?

>'genclntsh: Failed to link libclntsh.so.10.1. have you run across a similiar problem?

What is the ld error output?

>Sajjad: A symbolic link is like a Windows shortcut

A symlink is better than a shortcut since a shortcut can't be a directory in the middle of a windows path.
Dennis Handly
Acclaimed Contributor

Re: softlink problem

>this should be linked to /opt/aCC/bin/aCC per oracle.

I just checked, changing the link is absolutely useless, unless you want to upset swverify.

Since /opt/aCC/bin/cc is a hardlink to aCC, it should be exactly the same.
Donald Thaler
Super Advisor

Re: softlink problem

changed the softlink back... when i try a maunual link i get this error:

oracle@apollo$ make -f ins_rdbms.mk install
chmod 755 /u01/app/oracle/product/10.2.0.4/bin
rm -f oracle dbv tstshm maxmem orapwd dbfsize cursize genoci extproc extproc32 hsalloci hsots hsdepxa dgmgrl dumpsga mapsga osh sbttest expdp impdp imp exp sqlldr rman nid extjob extjobo genezi ikfod grdcscan /u01/app/oracle/product/10.2.0.4/rdbms/lib/ksms.s /u01/app/oracle/product/10.2.0.4/rdbms/lib/ksms.o

- Linking DB*Verify utility (dbv)
rm -f /u01/app/oracle/product/10.2.0.4/rdbms/lib/dbv
cc -Wl,+s -Wl,+n +DD64 -o /u01/app/oracle/product/10.2.0.4/rdbms/lib/dbv -L/u01/app/oracle/product/10.2.0.4/rdbms/lib/ -L/u01/app/oracle/product/10.2.0.4/lib/ /u01/app/oracle/product/10.2.0.4/rdbms/lib/s0kudbv.o /u01/app/oracle/product/10.2.0.4/rdbms/lib/defopt.o -ldbtools10 -lsnls10 -lunls10 -lnls10 -lclntsh `cat /u01/app/oracle/product/10.2.0.4/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0.4/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /u01/app/oracle/product/10.2.0.4/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0.4/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /u01/app/oracle/product/10.2.0.4/lib/sysliblist` -lm `cat /u01/app/oracle/product/10.2.0.4/lib/sysliblist` -lm -lpthread -lpthread
ld: Mismatched ABI (not an ELF file) for -lclntsh, found /u01/app/oracle/product/10.2.0.4/lib//libclntsh.sl
Fatal error.
*** Error exit code 1
*****************************************
the file libclntsh.sl exists but it's empty

what does mismatched ABI mean ?
James R. Ferguson
Acclaimed Contributor

Re: softlink problem

Hi Donald:

A "Mismatched ABI (not an ELF file)" means that you are trying to mix 32-bit and 64-bit objects during linking. This is not allowed. The linker determines the "bitness" to use by the "bitness" of the first object.

In this case, it looks like '/u01/app/oracle/product/10.2.0.4/lib//libclntsh.sl' was erroneously selected.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: softlink problem

>when I try a manual link I get this error:
ld: Mismatched ABI (not an ELF file) for -lclntsh, found /u01/app/oracle/product/10.2.0.4/lib//libclntsh.sl

What do you mean "manual" link?

What does file(1) show for that shlib? PA?
You need to add a -L path the only includes IPF shlibs.

Most likely this should be removed:
-L/u01/app/oracle/product/10.2.0.4/lib/


>JRF: A "Mismatched ABI (not an ELF file)" means that you are trying to mix 32-bit and 64-bit objects during linking.

Since this is Integrity, this isn't the issue. It is purely PA vs. IPF. And on Integrity, shlibs should end in .so.

>In this case, it looks like '/u01/app/oracle/product/10.2.0.4/lib//libclntsh.sl' was erroneously selected.

Yes.