LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-25-2008, 01:49 PM   #1
cold
Member
 
Registered: Feb 2004
Posts: 34

Rep: Reputation: 15
Cannot execute symbolic link on Debian


hi there,
I have strange problem (strange for me) with sym-links:

1. I have executable, I can execute it by (chmod is 777 for sure):
../usr/bin/ccache

2. I create the sym-link
ln -sf ../usr/bin/ccache mylink

3. chmod 777 mylink (for sure)

4. ./mylink
error message comes up: "no such file or directory".

Please tell me what am I doing wrong?

Thnx in advance.

-jn.
 
Old 06-25-2008, 02:07 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, Minix, OpenBSD, Slackware, SuSE
Posts: 1,757

Rep: Reputation: 80
I get the same error, but looking at ccache man page shows where/how to put the symbolic link. I followed those instructions and didn't see the error. I'm not sure if that's what you need to do.
 
Old 06-25-2008, 02:18 PM   #3
cold
Member
 
Registered: Feb 2004
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks for hint. I've tried but no effect. Still the same problem :-(.
 
Old 06-25-2008, 02:36 PM   #4
masinick
Member
 
Registered: Apr 2002
Location: Clinton Township, MI
Distribution: Debian, antiX, Kubuntu, Xubuntu, and many others
Posts: 573
Blog Entries: 14

Rep: Reputation: 44
I noticed what appeared to be some extra .. in your spec

Quote:
Originally Posted by cold View Post
Thanks for hint. I've tried but no effect. Still the same problem :-(.
In general, the symbolic link has the syntax:

Code:
ln -sf /FullPath-to-Real-Image Fake-link
Assuming the place you mention is correct, then the correct command would be something like:

Code:
(cd ~; ln -sf /usr/bin/ccache mylink)
This command:

1. Makes sure you are in your home directory, where you most certainly ought to be able to create a link and

2. Makes sure to use an absolute path name to the procedure.

A couple of other points:

1. Instead of using a compound command, you can also separate it into two distinct commands if you do not mind ending up in your home directory:

Code:
cd ~; ln -sf /usr/bin/ccache mylink
2. To ensure that /usr/bin/ccache is really a file and is accessible, try this:
Code:
file /usr/bin/ccache
That will tell you what kind of a file (executable, shell script, link, etc. this file appears on your system. If you believe that it could be a link, then
Code:
ls -l /usr/bin/ccache
will show you the location if there are links, then you can follow the potential cascade of links to either find a file pointed to by the links or a breakage of the links.

On my system, I in fact do not have such a file at all. Check yours to be sure what you are looking for is actually there and it is what you expect it to be.

Hope this helps you out.

Last edited by masinick; 06-25-2008 at 02:40 PM.
 
Old 06-26-2008, 06:12 AM   #5
cold
Member
 
Registered: Feb 2004
Posts: 34

Original Poster
Rep: Reputation: 15
hi there,
thanks for hints. The only problem is that I cannot execute the link. The target is executable, I can execute "../usr/bin/ccache" (rights are 777 for sure). I've tried to create a link with absolute and with relative path as well, the behavior is the same.
What is strange for me, I can edit the file that the link points to, e.g.

1. ln -sf ../usr/bin/ccache mylink
2. file mylink
-> ... symbolic link to ...
3. vim ./mylink (rights are also set to 777)
(not nice, I know :-)). But I can see the content of the binary file!
4. ./mylink
mylink: no such file or directory.

Is it possible that there's some problem with SELinux? Or some strange access right settings that dinosaur like me is not aware of? :-).
Thanks in advance.

-jn.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create symbolic link to html file and avoid page link problem? haxpor Linux - General 2 01-29-2008 08:40 AM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 11:01 AM
symbolic link jsetter Linux - Newbie 4 11-22-2004 08:18 AM
Symbolic link. bulzbb Linux - General 8 03-19-2004 05:57 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 11:06 PM


All times are GMT -5. The time now is 09:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration