Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
granting permission to tomcat
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
vinodramu
n00b
n00b


Joined: 23 Nov 2006
Posts: 44

PostPosted: Thu Feb 26, 2009 6:01 am    Post subject: granting permission to tomcat Reply with quote

I need to find out the disk usage using the command du -chs directoryName.
I'm executing a shell script using java web application.
For this I need to grand the permission to "tomcat" for accessing the directory and shell script.

For eg:
My shell script is in /var/lib/tomcat-6/webapps/webapplictionPRJ/scripts/ directory
and I need to find out the disc usage of the directory /var/vpopmail/testDirectory.
The owner of directory '/var/vpopmail' is root and owner of directory '/var/vpopmail/testDirectory'
is vpopmail

Can anyone help me in granting permission to tomcat for accessing the directory using "visudo".
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Fri Feb 27, 2009 9:33 am    Post subject: Reply with quote

Depending on your use case, you may be able to find a more secure way of doing this. For example, you could run a cron job (as root). For example:
du -chs /var/vpopmail/testDirectory > /var/vpopmail/admin_data

Then your shell script could read the data without elevated privileges.

But if you want to go the sudoers route, I believe an entry like the following would suffice, and be as restrictive as possible. But I haven't tested that and you may have to fiddle with the syntax or something (see the 'sudoers' man page).

Code:
vpopmail     localhost=/bin/du -chs /var/vpopmail/testDirectory
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum