I am running Debian testing and I am not able to run any binary or shell script. I keep getting "No such file or directory" for binaries and "Permission denied" for executable shell scripts. The umask is the default one and I haven't fooled around with the paths. Also, I am aware of this question, but it doesn't work out for me - I compiled my code on this machine and trying to run it on the same machine. Also, all of my shell scripts have the correct shebang.

Any advices?

Edit: I am not running any Armor or SELinux kind of application.

link|improve this question

50% accept rate
Can you add a little more information? Long-list the directory? Long-list your scripts? Example of scripts being executed? Full output from the command-line when you execute a script? – bedwyr Apr 26 '10 at 20:17
Do the common system commands work (like ls, cd or mv)? – dag729 Apr 26 '10 at 20:17
@dag729: yes, they do – hyperboreean Apr 26 '10 at 20:19
7  
Check to see if the filesystem you're on is mounted with the noexec option. Also, copy paste a session from your terminal into the question here, so people don't have to ask all kinds of question. Or even take a screenshot of your terminal... – nos Apr 26 '10 at 20:42
3  
Ok, replaced the fstab entries with default and now it's working. Thanks, nos, if you're adding the comment as an answer I can give you credit for it. – hyperboreean Apr 26 '10 at 20:56
show 9 more comments
feedback

1 Answer

More information including copy/paste of a terminal session would be helpful. But things to look for right away are that the binaries and scripts have the correct permissions (usually mode 0755). Double check that the shebang line in your scripts points to a valid binary. Run the "file" command on a binary to make sure it is a true binary for your architecture. Surely not all of your binaries get "no such file or directory", otherwise you wouldn't have been able to compile your code. Try the "which" command to see if your shell can find the binary you're trying to run (e.g. "which date" to see which command would run if you typed "date") and to make sure it is finding the one you think you're trying to run (sometimes a command appears earlier in your PATH and you're not aware of it).

link|improve this answer
Oops, I see you already found the problem and it was apparently due to incorrect mount options on the filesystem. Glad you found the problem. – Marnix A. van Ammers Apr 26 '10 at 21:18
feedback

Your Answer

 
or
required, but never shown

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