1

I'm having a perplexing issue. If I try to run a script via:

root@myServer:~/dig# ./minerd.sh

I get:

-bash: ./minerd.sh: No such file or directory

If I try:

root@myServer:~/dig# ~/dig/minerd.sh

I still get:

-bash: /root/dig/minerd.sh: No such file or directory

If I do:

root@myServer:~/dig# ls ~/dig/minerd.sh

Then I get:

/root/dig/minerd.sh

So, the file is clearly there. I have also previously done chmod +x on it. But still, its not allowing me to run it for some reason. What am I doing wrong?

Edit: Even moving the file to a different name doesn't work:

root@myServer:~/dig# mv minerd.sh test.sh
root@myServer:~/dig# ./test.sh
-bash: ./test.sh: No such file or directory
  • What is the output of ls -la ./minerd.sh – David Wilkins Feb 27 '14 at 19:51
  • @DavidWilkins -rwxr-xr-x 1 1000 1000 379680 Jul 10 2013 ./minerd.sh – Click Upvote Feb 27 '14 at 19:52
  • Well that shows that it is executable, so that isn't the problem – David Wilkins Feb 27 '14 at 19:53
  • @DavidWilkins Yes. I downloaded the file via links http://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.3.2-linux-x86.tar.gz/download and then extracted it via tar -xvf *.gz if that might have any bearing on it – Click Upvote Feb 27 '14 at 19:55
  • You say that the file is binary, to confirm, what is the ouput of file minerd – David Wilkins Feb 27 '14 at 20:03
  • @DavidWilkins minerd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xdd6392f744de0cec6323c610bdd2300851af2e5b, stripped – Click Upvote Feb 27 '14 at 20:04
  • 1
    Next thing to check (although a different error message would have been produced) is to run ldd minerd. Make sure that all of the link libraries are actually found on the system. Also, If this is a 64-bit system, do you have 32-bit compatibility libraries installed? Final comment - don't run unknown programs as root - use a non-privileged account. – doneal24 Feb 27 '14 at 20:10
  • @DougO'Neal ldd minerd gives not a dynamic executable. – Click Upvote Feb 27 '14 at 20:15
  • @DougO'Neal Which is strange because running the same command locally gives me a list of some libraries. You're right on the 32 vs 64 bit thing, this is a 64 bit system that i'm running it on. – Click Upvote Feb 27 '14 at 20:16
  • @DougO'Neal You were right, when I downloaded the 64 bit version of this program, that works fine. Thanks! Feel free to post that as answer and i'll accept. – Click Upvote Feb 27 '14 at 20:19
  • Once you've read the duplicate, you might also want to read this for installing the 32bit libraries. – terdon Feb 28 '14 at 00:11

1 Answers1

5

Check the '#!' line, the very first line of the file. If you have a typo in the shell path, you will get that message.

If the '#!' line looks good, try doing xxd minderd.sh - look carefully in the output for non-printing byte values. You can have an "invisible typo".

EDIT Since you mention it's a binary file, which I assume means a compiled executable, do this:

ldd minderd.sh

That will show you things like what dynamic libraries the file needs, and where the dynamic linker will get them. I bet you that whatever dynamic linker the executable wants (which is /lib/ld-linux.so.2 based on your comment above), doesn't exist on your system.

  • Actually this file is a binary I believe. Its original name was just minerd, I renamed to minerd.sh to see if that might help. If I nano it, i just see binary code. – Click Upvote Feb 27 '14 at 20:02
  • Strange thing is, if I follow the same steps in downloading this file locally, it works fine. Could it be that my VPS host has disabled running dogecoin miner type of applications and that's why its not running? – Click Upvote Feb 27 '14 at 20:04
  • @ClickUpvote I would think they would give a meaninfgul error if that was the case, but it is possible – David Wilkins Feb 27 '14 at 20:05
  • @DavidWilkins Exactly. I'm running Ubuntu 13 on the server if it helps. – Click Upvote Feb 27 '14 at 20:07
  • So you have systems where it works, and others where it doesn't. Are both 64 (or 32) bits? If both 64 bits, perhaps one is set up to run 32-bit executables, the other one isn't? Also note that Linux can be set up to run alien executables (e.g. Java bytecode) directly. What does file minerd.sh say? Are you sure that the executable isn't corrupt? – vonbrand Feb 27 '14 at 20:23
  • @vonbrand No, the system where it works was 32 bit. The other is 64 bit. Downloading the 64 bit binary to it fixed it. – Click Upvote Mar 01 '14 at 02:32