0

I have 2 MIPS routers running openwrt linux. On one of them things are fine and I can easily run my app from console. I copy it over scp (this is my app, one file) to another router and when I try to run it, I get "not found" error:

root@OpenWrt:~# pwd
/root
root@OpenWrt:~# ls -l
-rwxr-x---    1 root     root        132001 Apr  2 17:37 app
root@OpenWrt:~# ./app
ash: ./app: not found
root@OpenWrt:~# uname -a
Linux OpenWrt 3.7.9 #3 Mon Aug 5 16:25:53 EEST 2013 mips GNU/Linux

I'm not a newbie in linux, but can't find what the problem is here.

9
  • I'm not sure but something tells me that this has to do with missing dependencies. Maybe the linker can't find a given dependency that's present on router 1 but not on router 2. Try re-compiling the binary on the target platform.
    – jDo
    Apr 22, 2016 at 13:27
  • can you run "file ./app" to check if its actually an executable Apr 22, 2016 at 13:28
  • @jDo Maybe depenencies are missing. That is surely possible. But I didn't expect no get "Not found" error here. I don't have ldd on the target platform, so I don't know how to check what dependencies are missing. Do you have any suggestions how to do it? Apr 22, 2016 at 13:28
  • 1
    @rightaway717 Just found this that seems to re-produce/demonstrate the error
    – jDo
    Apr 22, 2016 at 13:32
  • 1
    @jDo ok, this seems to be the case. thank you. Please post an answer, so I could accept it when confirmed Apr 22, 2016 at 13:35

2 Answers 2

2

I'm certainly no compiler expert but from bitter experience when moving binaries around on embedded systems, this cryptic error leads me to believe that it's some sort of dependency error; likely a missing linker. Recompiling the binary on the target system has solved the issue for me in the past.

As Kevin Vasko asked in the comments: "can you run ldd ./app on it?"

This is a good way of determining which libraries and linker the program expects. One can also do as suggested in this answer that demonstrates a similar issue and run the following command to get only the "program interpreter" line (ldd will show several dependencies):

readelf -l app | grep "program interpreter"

On my system, this shows the GNU linker, ld, but with an explanatory line of text that might be helpful [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2].

Thus, I suspect that if I removed this "program interpreter" from my system, I would get the same error (and probably quite a few others). Again, try recompiling the binary on the target system or satisfy any missing dependencies manually by moving the right files into the right places.

1
  • Thank you for your help. I don't have ldd or readelf on target system , but I have them on the working router, so I checked the dependencies there, copied missing ones to the target router and it worked. Apr 22, 2016 at 14:28
0

Inside of your ./app I have a feeling you are calling something doesn't exist. In this case the "ash" command.

Based on this error

ash: ./app: not found

I feel you are running a piece of code inside of your ./app. Based on the "ash" I would say you are trying to run "bash". If I had to guess you mistyped your header in your script

#!/bin/bash
3
  • no, sorry, this is a c++ app actually. no shell here Apr 22, 2016 at 13:17
  • @rightaway717 Ah, well is your doing anything with the "ash" shell? Apr 22, 2016 at 13:21
  • no, nothing except that I try to run the app in it. I also tried to run it from plain sh Apr 22, 2016 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.