LinuxQuestions.org
Register a domain and help support LQ
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 08-08-2006, 03:08 AM   #1
iknight
LQ Newbie
 
Registered: Aug 2006
Location: Bristol, UK
Distribution: SuSE Linux 7.3 - Personal
Posts: 7

Rep: Reputation: 0
Cannot run an executable in current directory even using ./


Hi all,

Having downloaded an Astronomy program from the Internet, unTARed the content and run the install script, I now apparently have all executables and files in place where they should be.

However, if I then navigate to the directory holding the executable and ls -l, I can see it listed showing that it can be executed by all. If I then type the executable name (xplns), I get a directory/file does not exist type message. If I type ./xplns I still get the same error !

Can anyone explain to me what I am doing wrong ? I am running SuSE Linux 7.3.

Regards,

Ian.
 
Old 08-08-2006, 03:15 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
If you're sure you're in the same directory and the permissions are set correctly on the file (+x set for your user at least), a
Code:
./xplns
should give you at least a message (why?) the file cannot be executed. Make sure you type it correctly (uppercase letters differ from lowercase!)

After this make sure the directory you're in is made executable, it might affect..

What exactly do you get with
Code:
ls -l xplns
and
Code:
ls -ld ./
?
 
Old 08-08-2006, 03:23 AM   #3
iknight
LQ Newbie
 
Registered: Aug 2006
Location: Bristol, UK
Distribution: SuSE Linux 7.3 - Personal
Posts: 7

Original Poster
Rep: Reputation: 0
Hi b0uncer,

I've checked that the file is executable uning ls -l, and thats OK, I've double-checked that the file name typed in is in the same case as the file listed.

However I have not checked to see if the directory itself is executable. I'll ls -ld ./ and see what is returned.

Thanks for the suggestions !

Ian.
 
Old 08-08-2006, 04:39 AM   #4
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Code:
file xpnls
Check that it is compiled for your architecture. I've seen zsh throw up file not found errors when in reality it can't execute the binary.
 
Old 08-08-2006, 06:38 AM   #5
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
I've seen zsh throw up file not found errors when in reality it can't execute the binary.
Wow I hope you've made sure the zsh creators know that? Sounds almost too Windows to me - error messages that are not telling anything about the actual problem..
 
Old 08-08-2006, 09:46 AM   #6
sabit
Member
 
Registered: Dec 2004
Distribution: Gentoo
Posts: 44

Rep: Reputation: 15
Is the executable located in a filesystem that is mounted with noexec option? (/etc/fstab)
 
Old 08-09-2006, 03:10 AM   #7
iknight
LQ Newbie
 
Registered: Aug 2006
Location: Bristol, UK
Distribution: SuSE Linux 7.3 - Personal
Posts: 7

Original Poster
Rep: Reputation: 0
I have now checked the directory holding the executable, and all directories above up to root level. All have permissions as follows : drwxr-xr-x

The xplns executable has permissions as follows : -rwxr-xr-x

So I cannot see any write permission problems there.

I then ran file xplns which gave the following output :

xplns:ELF 32-Bit Binary LSB Executable Intel 80386 Dynamically linked (uses shared libs), stripped

I had another look at the vendors FAQ page regarding the product installation. The ELF executable was apparently created for Slackware 3.x Linux, (tar.gz files) so maybe I downloaded and installed the wrong set of files. Alernative downloadables are as follows :

Red Hat (glibc 2.1/2.2/2.3 - .rpm files) or FreeBSD (FreeBSD i386 ELF - .tgz files)

I then read that SuSE 7.3 uses glibc 2.2. The vendor recommends checking which glibc version to download by issuing command ls /lib/libc-* however, this resulted in no matching files. So now I am not sure whether SuSE uses glibc or not.

I didn't know that program install packages were so distribution dependant.

Should I remove the current installation and try the glibc 2.2 version anyway, or is there another way of confirming which sets of files I should download ?

Regards,

Ian.
 
Old 08-09-2006, 11:49 AM   #8
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 61
Appears to me there are plenty of binaries available for that program. Is there a reason you have to install from source?
 
Old 08-10-2006, 03:07 AM   #9
iknight
LQ Newbie
 
Registered: Aug 2006
Location: Bristol, UK
Distribution: SuSE Linux 7.3 - Personal
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Rickh,

I thought I was using binaries ... I downloaded the software plus zipped star catalogue files from the vendors website below.

http://www.astroarts.com/products/xplns/download.html

Most other sites I have found via Google by searching on xplns, point back to this download site, again giving you the choice of glib2.1, glib2.2, glib2.3 or libc5.

Could you point me to some of the locations of binaries you mention ?

Regards,

Ian.
 
Old 08-12-2006, 03:38 AM   #10
iknight
LQ Newbie
 
Registered: Aug 2006
Location: Bristol, UK
Distribution: SuSE Linux 7.3 - Personal
Posts: 7

Original Poster
Rep: Reputation: 0
Hi all,

Problem solved !

Having mamaged to confirm SuSE 7.3 uses the glibc2.2 (soname - libc.so.6) libraries, I uninstalled the existing version of xplns (libc5), and downloaded and installed the glibc2.2 rpm files.

Now upon typing just xplns at the console, the application starts up fine and works flawlessly.

So, cs-cam, your suspicions were confirmed, i.e. the file not found error was just reflecting the wrong version for my linux installation.

Many thanks for all the contributions !

Ian.
 
Old 08-12-2006, 01:27 PM   #11
soggycornflake
Member
 
Registered: May 2006
Location: England
Distribution: Slackware 10.2, Slamd64
Posts: 249

Rep: Reputation: 31
Quote:
Originally Posted by b0uncer
Quote:
I've seen zsh throw up file not found errors when in reality it can't execute the binary.

Wow I hope you've made sure the zsh creators know that? Sounds almost too Windows to me - error messages that are not telling anything about the actual problem..
It has nothing to do with zsh, that is the error message is returned by the kernel (often because some shared lib can't be found, as seems to have been the case here).

You can confirm this easily; copy, say, /bin/bash to /tmp/foo/bash, then (as root) cd /tmp/foo and strace chroot . ./bash. I get:

Code:
...
execve("./bash", ["./bash"], [/* 122 vars */]) = -1 ENOENT (No such file or directory)
...
P.S. In these situations, the first tools I'd use are ldd and strace. For most simple cases, these will show what the problem is.

Last edited by soggycornflake; 08-12-2006 at 01:38 PM.
 
  


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 untar a file in another directory other then current directory. dr_zayus69 Linux - Software 8 05-16-2007 12:01 PM
How to run COFF executable in current distro? TimSNL Linux - General 1 01-28-2005 03:37 PM
an executable that does not run jgoggel Programming 2 07-22-2004 08:54 PM
Determine Executable Starting Directory codeblue Programming 4 10-17-2003 11:11 AM
How do I run my executable?? scott7500 Programming 2 12-30-2001 05:22 PM


All times are GMT -5. The time now is 10:45 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