You are not logged in.

#1 2013-10-14 21:44:24

The Compiler
Member
From: Switzerland
Registered: 2011-05-01
Posts: 214
Website

Getting "No such file or directory" when executing existing binary

Heya,

I'm currently trying to get hpasm to run, but after installing I have some strange issue.

The binary is there  but I can't execute it:

[florian@moody ~]$ ls -l /usr/sbin/hpasmcli
lrwxrwxrwx 1 root root 26 Oct 14 23:30 /usr/sbin/hpasmcli -> /opt/compaq/utils/hpasmcli
[florian@moody ~]$ ls -l /opt/compaq/utils/hpasmcli
-rwxr-xr-x 1 root root 131896 Oct 14 23:30 /opt/compaq/utils/hpasmcli
[florian@moody ~]$ /opt/compaq/utils/hpasmcli
bash: /opt/compaq/utils/hpasmcli: No such file or directory

Running ldd and file on it also looks strange:

[florian@moody ~]$ ldd /opt/compaq/utils/hpasmcli
        not a dynamic executable
[florian@moody ~]$ file /opt/compaq/utils/hpasmcli
/opt/compaq/utils/hpasmcli: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, for SuSE 9.1, not stripped

strace reveals execve() returns ENOENT:

[florian@moody ~]$ strace /opt/compaq/utils/hpasmcli
execve("/opt/compaq/utils/hpasmcli", ["/opt/compaq/utils/hpasmcli"], [/* 42 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
exit_group(1)                           = ?
+++ exited with 1 +++

but man 3 execve says:

ERRORS
       The exec functions shall fail if:
[...]
       ENOENT A component of path or file does not name an existing file or path or file is an empty string.

So I have no idea what's going on here... Just some weird broken binary?

Florian


>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance

Offline

#2 2013-10-14 22:36:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Getting "No such file or directory" when executing existing binary

I get

$ /opt/compaq/utils/hpasmcli
ERROR: You must be root to run hpasmcli.
$ sudo /opt/compaq/utils/hpasmcli
ERROR: hpasmcli only runs on HP hardware.

What's the output of 'uname -m'?

Last edited by karol (2013-10-14 22:37:22)

Offline

#3 2013-10-15 00:27:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,230
Website

Re: Getting "No such file or directory" when executing existing binary

http://stackoverflow.com/questions/5234088/execve-file-not-found-when-stracing-the-very-same-file wrote:

The file you're trying to execute (…/lmutil) exists but its “loader” doesn't exist, where

the loader of a native executable is its dynamic loader, for example /lib/ld-linux.so.2;
the loader of a script is the program mentioned on its shebang line, e.g., /bin/sh if the script begins with #!/bin/sh.

The PKGBUILD is not compiling anything, only converting an existing binary RPM to pkg.tar.gz so my best guess is that the binary (compiled for SuSE 9.1 apparently) is linked against libs that aren't available in Arch (anymore).

Although, that doesn't quite explain why karol can run it.... I'm guessing a missing dependency that karol just happens to have.

@karol, can you ldd against it and see what packages "The Compiler" might be missing?

Offline

#4 2013-10-15 00:31:16

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Getting "No such file or directory" when executing existing binary

Do you mean like this:

$  ldd /opt/compaq/utils/hpasmcli
	linux-gate.so.1 (0xb771a000)
	libhpasmintrfc.so.1 => /usr/lib/libhpasmintrfc.so.1 (0xb7703000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0xb76e7000)
	libc.so.6 => /usr/lib/libc.so.6 (0xb7537000)
	/lib/ld-linux.so.2 (0xb771b000)

Offline

#5 2013-10-15 01:07:56

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Getting "No such file or directory" when executing existing binary

If it's a 32 bit binary on a 64 bit system without the correct 32 bit libraries, this will always happen. The Compiler, did you use the AUR package to install this or did you do it manually?

***EDIT***

The AUR package installs the 32 version even on 64 bit machines. If there is a 64 bit version, then the PKGBUILD is broken. If there isn't one, then you need to find the dependencies and install the 32 bit equivalents.

***EDIT 2***

I felt like looking into this and this software is almost seven years old. Even with legacy servers, HP must have modern tools for Proliant class servers.

Last edited by skottish (2013-10-15 02:21:05)

Offline

#6 2013-10-15 04:21:15

The Compiler
Member
From: Switzerland
Registered: 2011-05-01
Posts: 214
Website

Re: Getting "No such file or directory" when executing existing binary

The system is 64 bit (x86_64) indeed.

skottish wrote:

If it's a 32 bit binary on a 64 bit system without the correct 32 bit libraries, this will always happen. The Compiler, did you use the AUR package to install this or did you do it manually?

I used the AUR package.

skottish wrote:

The AUR package installs the 32 version even on 64 bit machines. If there is a 64 bit version, then the PKGBUILD is broken. If there isn't one, then you need to find the dependencies and install the 32 bit equivalents.

I think the PKGBUILD looks good, but their original RPM is broken. When I download and extract the 64 bit RPM by hand, _one_ binary is 64 bit, the others are 32bit:

[florian@moody utils]$ file *
bootcfg:          ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, for SuSE 9.1, not stripped
hpasmcli:         ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, for SuSE 9.1, not stripped
hpimlview:        ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.1, for SuSE 9.1, not stripped
hplog:            ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, for SuSE 9.1, not stripped
hpuid:            ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, for SuSE 9.1, not stripped
imlbe:            ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, for SuSE 9.1, not stripped
[...]
skottish wrote:

I felt like looking into this and this software is almost seven years old. Even with legacy servers, HP must have modern tools for Proliant class servers.

Hmm, that's a good point actually. I'll dig a bit and see what I'll find.

Florian


>>> from __future__ import braces
  File "<stdin>", line 1
SyntaxError: not a chance

Offline

#7 2013-10-15 16:14:35

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Getting "No such file or directory" when executing existing binary

So it's a sort of 64 bit package. It still makes my comment about the PKGBUILD wrong.

Anyway, hpasmcli needs at least glibc and it looks like the Arch version will work. Install lib32-glibc from [multilib] and see if it runs.

utils > readelf -d hpasmcli | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libhpasmintrfc.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

Offline

#8 2013-10-20 10:39:02

Ian_Jordan
Member
Registered: 2013-10-20
Posts: 2

Re: Getting "No such file or directory" when executing existing binary

I recently had a similar experience albeit on my HTPC, I was getting the same error trying to run a perl script, the problem was systemd had changed (possibly to default) my fstab options, my /home partition didn't have exec permissions set. It was such a simple thing that it would be easy to overlook.

Offline

Board footer

Powered by FluxBB