LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2009, 08:46 AM   #1
shred_eng
LQ Newbie
 
Registered: Sep 2009
Posts: 25

Rep: Reputation: 15
scripts and directory permissions, help needed


hi, i have installed a game - enemy territory and a mod - jaymod.

jaymod has a script which when executed gives errors which are: permission denied. i have set the folders where the script needs access to as 0777.and have tried a few other number combinations but still the same result. how can i set things so that this script can access the folder and files? the directories and files are in /home/shred_eng
and the script is in there also. any ideas...

thanks,
 
Old 09-11-2009, 09:07 AM   #2
Amy84
LQ Newbie
 
Registered: Aug 2009
Location: Netherlands
Distribution: CentOS 5.3
Posts: 27

Rep: Reputation: 15
Please post the outcome of:

ls -l /home/shred_eng
 
Old 09-11-2009, 10:00 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,614

Rep: Reputation: 440Reputation: 440Reputation: 440Reputation: 440Reputation: 440
shred_eng,

The folder was set to 0777 but the contents therein including the script may not have been set equally if you did not use the -R switch to the chmod. So you may try set the same permission to the contents of the folder. In your case:

--$: chmod -R /home/shred_eng/* 0777

try run the game. Check back how it goes.

hope this helps.
good luck.
 
Old 09-11-2009, 10:13 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by shred_eng View Post
hi, i have installed a game - enemy territory and a mod - jaymod.

jaymod has a script which when executed gives errors which are: permission denied. i have set the folders where the script needs access to as 0777.and have tried a few other number combinations but still the same result. how can i set things so that this script can access the folder and files? the directories and files are in /home/shred_eng
and the script is in there also. any ideas...

thanks,
Although 0777 sounds like it ought to open everything up, it can cause breakage, for example by removing setuid and sticky bits. chmod -R 0777 is a big sledge hammer that may cause enough damage to require re-installation.

Better, if possible, to find out exactly what in the jaymod script gave the "permission denied" errors, understand why and make the minimum necessary changes.

Last edited by catkin; 09-11-2009 at 10:15 AM.
 
Old 09-11-2009, 10:56 AM   #5
shred_eng
LQ Newbie
 
Registered: Sep 2009
Posts: 25

Original Poster
Rep: Reputation: 15
thanks for replies

amy84,outcome is;
drwxrwxrwx 7 shred_eng shred_eng 4096 2009-09-07 23:41 enemy-territory

lrwxrwxrwx 1 shred_eng shred_eng 104 2009-09-07 14:41 et - > /var/www/enemy-territory//etded (this is the executable im using to run the game in server mode, non graphical)

-rwxrwxr-x 1 shred_eng shred_eng 7601 2009-09-08 12:47 serverctl (this is the script file)

already this looks weird as the main files were installed to /home/shred_eng, but... i originally installed it to /var/www/enemy-territory and the script brought the error permission denied as my first post states.so i moved the directory using remote access with wincsp or is it wincps anyway it moved the directory but resulted in an error like there was corrupted files so i deleted the enemy-territory directory and reinmstalled to /home/shred_eng. hope this all makes sense.

so now the path above is wrong.

malekmustaq, i tried your suggestion anyway and got error: invalid mode.

thanks,

edit: catkin, the permission denied was referring to all directories and files related to the game, it stated the paths and all ended in permission denied. (all paths were correct if /home/shred_eng/enemy-territory is where game files are located - should be )

Last edited by shred_eng; 09-11-2009 at 11:18 AM.
 
Old 09-11-2009, 11:30 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by shred_eng View Post
so now the path above is wrong.
It's going to be easier to start over, being as how you have just installed.

Which user is trying to play this game? Assuming it is your own, you are shred_eng, and you have enough space on the file system containing /home/shred_eng/enemy-territory ...
Code:
/bin/mv /home/shred_eng/enemy-territory /home/shred_eng/enemy-territory.aside
and install to /home/shred_eng/enemy-territory again then try to start the game and copy-and-paste us what you get on the terminal.

When posting code or terminal output here, it is easier to read if you put it in code tags.

Anticipating that permissions are going to be a problem please post the output from
Code:
/bin/ls -ld /home/shred_eng/enemy-territory
/bin/ls -l /home/shred_eng/enemy-territory
/usr/bin/id
 
Old 09-11-2009, 11:38 AM   #7
shred_eng
LQ Newbie
 
Registered: Sep 2009
Posts: 25

Original Poster
Rep: Reputation: 15
im not sure how to save the console output.i installed ubuntu server, there is no desktop so how do i do this? it doesnt have a browser either.how would i collect the (log?) or whatever.i guess if it saves a log i can use the winscp thing and get it that way. meanwhile i'll try doing the other stuff you said,
thx,
 
Old 09-11-2009, 12:21 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
I'm not familiar with it but I understand the "screen" command (see its man page) allows copy -- but where would you paste to?!

Alternatively you could use the "script" command to capture all bytes going to and from your terminal to a file and then access that file from a GUI system and copy and paste from it to LQ. Here's a simple script session
Code:
c@CW8:~$ script /tmp/script.log
Script started, file is /tmp/script.log
c@CW8:~$ /bin/ls
Azureus Downloads  Desktop    gconfd-c	   google-earth    mnt	    pulse-c	seahorse-ivAVKQ  Templates
d		   Downloads  googleearth  keyring-F92NZj  orbit-c  Repository	Shell Folders
c@CW8:~$ exit
exit
Script done, file is /tmp/script.log
c@CW8:~$ cat /tmp/script.log
Script started on Friday 11 September 2009 09:48:10 PM IST
c@CW8:~$ /bin/ls
Azureus Downloads  Desktop    gconfd-c	   google-earth    mnt	    pulse-c	seahorse-ivAVKQ  Templates
d		   Downloads  googleearth  keyring-F92NZj  orbit-c  Repository	Shell Folders
c@CW8:~$ exit
exit

Script done on Friday 11 September 2009 09:48:21 PM IST
Alternatively you could start a remote shell on your system from another system using a GUI terminal emulator, something along the lines of starting xterm or gnome-terminal then ssh or telnet into your non-GUI server ...

EDIT: instead of xterm or gnome-terminal you could start a "command prompt" window on Windows ...

Last edited by catkin; 09-11-2009 at 12:23 PM.
 
Old 09-11-2009, 01:08 PM   #9
shred_eng
LQ Newbie
 
Registered: Sep 2009
Posts: 25

Original Poster
Rep: Reputation: 15
all i can say to that catkin, is, WOW!!! leave it with me lol.

not sure if im able tbh.

anyway, i reinstalled and have a enemy-territory.aside with the old files in and a new enemy-territory directiry with the new files in @: /home/shred_eng/enemy-territory. i set the rest of the server files up and executed the script named serverctl it comes with the game mod called jaymod.its a server start- stop-restsrt- utility, and i think it does a few other things (dont know till i get it working)but when it runs it loops in memory, it doesnt use many resources - so, when it executes it just fills the terminal endlessly with the game file directory paths.im not sure if this is the case when its actually working properly but i wouldnt be surprised if it is. at the moment theres a jaymod directory inside the enemy-territory directory and the etmain directory also.this is where they belong.inside these directories are other files which the serverctl script trys to access.so the data looping through the terminal says: for example,

serverctl /enemy-territory/jaymod/mpgame.so permission denied
serverctl /enemy-territory/jaymod/jaymod.cfg permission denied
serverctl /enemy-territory/etmain/somegamefile.so permission denied

so i reckon if i captured the terminal output the info contained would be pages long, as it keeps on looping.

ideas?

thx again,
 
Old 09-11-2009, 02:28 PM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by shred_eng View Post
serverctl /enemy-territory/jaymod/mpgame.so permission denied
serverctl /enemy-territory/jaymod/jaymod.cfg permission denied
serverctl /enemy-territory/etmain/somegamefile.so permission denied
Find out what the permissions are on a few of the problem files with something like
Code:
cd enemy-territory
/bin/ls -l jaymod/mpgame.so jaymod/jaymod.cfg etmain/somegamefile.so
and post back. We don't need the size or time stuff so if it's something like
Code:
-r-x------ 1 c c  174 2009-09-01 23:14 test.sh
then just post these bits
Code:
-r-x------ 1 c c test.sh
With no copy-and-paste, we don't want ya to do too much typing!

Regards "not sure if im able tbh" I guess we all felt that way at the beginning (and I still feel that way about some of it now) but if you are interested and keep at it ... you'll get to be a geek and all the beautiful women will chase after you and you'll be really popular and the star at parties. Just kidding!
 
Old 09-11-2009, 04:02 PM   #11
shred_eng
LQ Newbie
 
Registered: Sep 2009
Posts: 25

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by catkin View Post
but if you are interested and keep at it ... you'll get to be a geek and all the beautiful women will chase after you and you'll be really popular and the star at parties. Just kidding!
just kidding huh?....oh well.....

all the relevent files are set at -rw-r--r-- 1
and the 2 directories were drwxr-xr-x

so i changed all those files and directories to 777 just to test if it worked but still had permissions problems, how can that be?

if i *ahem* we do get this working what do you think the proper permissions for these files and directories should be?

and also how would i remove this: lrwxrwxrwx 1 shred_eng shred_eng 104 2009-09-07 14:41 et - > /var/www/enemy-territory//etded
which is a non-existant path.
 
Old 09-11-2009, 05:23 PM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by shred_eng View Post
so i changed all those files and directories to 777 just to test if it worked but still had permissions problems, how can that be?
Error or feature in the script?

Quote:
Originally Posted by shred_eng View Post
if i *ahem* we do get this working what do you think the proper permissions for these files and directories should be?
What they were. Probably. Those were pretty standard permissions.

Quote:
Originally Posted by shred_eng View Post
and also how would i remove this: lrwxrwxrwx 1 shred_eng shred_eng 104 2009-09-07 14:41 et - > /var/www/enemy-territory//etded
which is a non-existant path.
By
Code:
/bin/rm et
but where should it be pointing? I thought that symlink was from your old installation that really was on /var/www/enemy-territory ... ? Check the ln command with the -s option for putting it back pointing to the right place.

Next step is to investigate the script and see why it's not happy with those permissions. Any way you can post it, or attach it if it's too big to post?
 
Old 09-12-2009, 12:26 PM   #13
shred_eng
LQ Newbie
 
Registered: Sep 2009
Posts: 25

Original Poster
Rep: Reputation: 15
hi catkin, thx for help so far, appreciated

the actual path for enemy-territory is /home/john/enemy-territory
(my real name)
and the symlink is pointing to a previous installation which i deleted ungracefully with winscp a remote access gui app (really useful for most things) but i should have removed it using proper procedings, rm/ etc.
i'll check the other stuff you suggested and heres a link for the script.

theres 2 - one i changed names and paths and the other an unedited version. see what you think,
theyre ok, no viruses.

link: http://collabfiles.googlepages.com/home

thx,

edit: just to remind, the serverctl is in /home/john

Last edited by shred_eng; 09-12-2009 at 12:29 PM.
 
Old 09-12-2009, 02:15 PM   #14
windtalker10
Member
 
Registered: Nov 2007
Location: Kentucky
Distribution: Slackware13.1
Posts: 214

Rep: Reputation: 38
Quote:
Originally Posted by shred_eng View Post
so i changed all those files and directories to 777 just to test if it worked but still had permissions problems, how can that be?
Files and scripts can have different chmod codes and if you use the wrong code, you've screwed up the permissions as scripts normally need more permissions than files do.
Note the following:

400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody

Read by owner is 400.
Write by owner is 200
Execute by owner is 100.

400+200+100= 700

Therefore r-w-e by owner is not 777, it's 700.
r-w-e by owner and group would be 770.
You may only need 001.
It can also be done as chmod +x.

You may also not own the file as user but root can own it instead and only be executed as root.
Try this as root:

Quote:
chown -R [username] /path/to/file

Last edited by windtalker10; 09-12-2009 at 02:23 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File permissions v. directory permissions Completely Clueless Linux - Newbie 7 07-09-2009 09:33 AM
help needed - webmin and cgi scripts chrismacca Fedora 0 11-02-2004 02:44 PM
Help needed in writing Awk Scripts.. TheDarktrooper Red Hat 1 05-04-2004 07:49 PM
File permissions and cgi scripts shaggystyle Linux - General 5 02-16-2004 03:36 PM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 04:04 AM


All times are GMT -5. The time now is 04:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration