Solved

Unable to execute a symbolic link in linux

Posted on 2010-09-11
8
614 Views
Last Modified: 2012-05-10
Running redhat enterprise linux 5. I created a symbolic link to a shell script but when I try to execute the symbolic link I get the message:
bash: ./stopall.sh: No such file or directory

My working directory is the directory containing the symbolic link and I tried executing it with the command:
./stopall.sh

Is there some other step I need to perform?
0
Comment
Question by:opike
  • 3
  • 3
  • 2
8 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 33655651
What does

ls -l stopall.sh

show?
0
 
LVL 9

Expert Comment

by:rfportilla
ID: 33655767
I dont' think your file is executable.  Either use

  chmod +x stopall.sh

or try

  . stopall.sh

Notice the . with a space after.
0
 

Author Comment

by:opike
ID: 33657091
Here is the output from ls -la (links definitely have execute permission set):

[ollie@oracleepm oraclelinks]$ ls -la
total 12
drwxrwxr-x  2 ollie ollie 4096 Sep 11 17:30 .
drwx------ 23 ollie ollie 4096 Sep 12 08:12 ..
lrwxrwxrwx  1 ollie ollie    8 Sep 11 17:25 startall.sh -> start.sh
lrwxrwxrwx  1 ollie ollie   15 Sep 11 17:30 startEssbase.sh -> startEssbase.sh
lrwxrwxrwx  1 ollie ollie    7 Sep 11 17:25 stopall.sh -> stop.sh
0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 33658521
There's your problem, you have a symbolic link pointing to a non-existent file.

Where does stop.sh exist?

You need to do

ln -s  /some/path/to/stop.sh stopall.sh
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 9

Expert Comment

by:rfportilla
ID: 33668462
That does kind of raise an interesting point.  I see that the file is executable, but it is pointing to something that is in the local directory or available through the path variable.  Does "./stop.sh" work?  Does ". stop.sh" work?  And, do the others work, startall.sh and startEssbase.sh?

 
0
 
LVL 48

Expert Comment

by:Tintin
ID: 33668803
rfportilla.

The symlinks won't work as they point to non-existent files.  Simple as that.
0
 
LVL 9

Expert Comment

by:rfportilla
ID: 33688841
@tintin, just checking all bases.  Seems like an odd question to ask about one particular symlink if none are working.  I just wanted to make sure that none of them are working.  No need to blast me... :-p
0
 

Author Closing Comment

by:opike
ID: 33698545
Mixed up order of arguments...
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't See Site After DNS Resolved 7 47
AD LDAP LDS 3 48
add some character at the end of line in vi 7 64
networking details on centos 6.6 4 53
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now