View previous topic :: View next topic |
Author |
Message |
vinodramu n00b
Joined: 23 Nov 2006 Posts: 44
|
Posted: Thu Feb 26, 2009 6:01 am Post subject: granting permission to tomcat |
|
|
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 |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Fri Feb 27, 2009 9:33 am Post subject: |
|
|
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 |
|
|
|