Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux permission denied after chmod a=rwx

So I have a little Linux problem, geez that will teach me to spend so many years on Windows. Anyway I did a little java app, wrapped nicely with the Java Service Wrapper script, but when I run that script:

sh ./wrapper.sh console

I get permission denied right away. The permission denied message is like that:

eval: 1: /home/user1/MyApp/bin/wrapper: Permission denied

My little wrapper.sh lives in the MyApp/bin folder. The directory MyApp/bin/wrapper contains 2 files:

  • wrapper-linux-x86-32
  • wrapper-linux-x86-64

As a test I ran the following chmod command:

chmod a=rwx MyApp -R

I verified that everything was rwx, even in the sub-folders and tried to run the script again, with the exact same result... permission denied.

Anyone has any idea of what I could try next to make that baby run?

Thanks, Lancelot

like image 929
Lancelot Avatar asked Apr 07 '09 23:04

Lancelot


1 Answers

I just noticed the error message references the name of the directory hosting your file:

eval: 1: /home/user1/MyApp/bin/wrapper: Permission denied

We know it's a directory since you mentioned "The directory MyApp/bin/wrapper contains 2 files".

Could you check your script for instance where you're using the name of the directory as a command? Such as using wrapper (which is the directory name) instead of wrapper/wrapper-linux-x86-32 (which would be a file name), or similar errors?

Similar errors often appear when using spaces in filenames and forgetting to quote said filenames (probably not the case here, though.)

Failing that, could you edit your question to include the contents of the wrapper script you're calling?

(New answer since it's completely unrelated to the previous noexec idea, and that one can stay for reference.)

like image 188
Mihai Limbășan Avatar answered Sep 24 '22 14:09

Mihai Limbășan