1752790 Members
6441 Online
108789 Solutions
New Discussion юеВ

Re: 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 14
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 ??