LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trouble executing a .sh file on centos 6.1 x64 on a remote linux server. (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-executing-a-sh-file-on-centos-6-1-x64-on-a-remote-linux-server-4175421747/)

cianz182 08-12-2012 04:01 PM

Trouble executing a .sh file on centos 6.1 x64 on a remote linux server.
 
Hi everyone,

I hope you are having a great day. I seem to be having trouble executing the shell file using the command.

I get the following message

[root@admin craftbukkit]# -bash: ./craftbukkit.sh: Permission denied

Any help would be appreciated!
Thanks!

chrism01 08-12-2012 04:04 PM

Show the ownerships+perms of the file.
Is it a bash file?
What EXACTLY was the cmd you used?

Habitual 08-12-2012 04:06 PM

terminal>
Code:

find `pwd` . -name craftbukkit.sh -exec ls -al {} \;
and
Code:

find `pwd` . -name craftbukkit.sh -exec head -2 {} \;
output please.

cianz182 08-12-2012 04:07 PM

Thanks for the prompt reply Chris the permissions are listed below

[root@admin craftbukkit]# ls -l
total 11444
-rw-r--r-- 1 root root 11697717 Aug 7 07:28 craftbukkit.jar
-rw-r--r-- 1 root root 63 Aug 12 20:53 craftbukkit.sh

The command I used to run the shell script was ./craftbukkit.sh

cianz182 08-12-2012 04:09 PM

Habitual the output you requested is listed below.

[root@admin craftbukkit]# find `pwd` . -name craftbukkit.sh -exec ls -al {} \;
-rw-r--r-- 1 root root 63 Aug 12 20:53 /root/craftbukkit/craftbukkit.sh
-rw-r--r-- 1 root root 63 Aug 12 20:53 ./craftbukkit.sh
[root@admin craftbukkit]# find `pwd` . -name craftbukkit.sh -exec head -2 {} \;
#!/bin/sh
screen java -Xms1024M -Xmx1024M -jar craftbukkit.jar
#!/bin/sh
screen java -Xms1024M -Xmx1024M -jar craftbukkit.jar

chrism01 08-12-2012 04:32 PM

Code:

-rw-r--r-- 1 root root 63 Aug 12 20:53 craftbukkit.sh
You have no execute perms set on that file, that's why it won't run.
Try
Code:

chmod u+x craftbukkit.sh
BTW, please use code tags https://www.linuxquestions.org/quest...do=bbcode#code

cianz182 08-12-2012 04:36 PM

Thanks Chris but now I get this error

Code:

./craftbukkit.sh: line 2: screen: command not found

chrism01 08-12-2012 04:38 PM

Means what it says;
1. screen is not installed
OR
2. screen is not in your user's $PATH

BTW, please add you distro+version to your profile, so we can help you better eg
Code:

cat /etc/*release*

cianz182 08-12-2012 04:44 PM

Thanks Chris my version is CentOS Linux release 6.0 (Final)I installed screen and it seems to work perfectly now.

Thank you very much for your help.(and patience!)

Kind Regards,
Cian


All times are GMT -5. The time now is 03:48 AM.