LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Tomcat file permissions. (https://www.linuxquestions.org/questions/linux-server-73/tomcat-file-permissions-688134/)

elprawn 12-03-2008 05:41 PM

Tomcat file permissions.
 
Hi. I have tomcat streaming files using one of my webapps, and if the file is from a certain directory on an external drive, I'd like to delete the file after streaming it, but tomcat needs root permissions to do so. I've tried changing the owner and permissions on the folder itself but it I get an "Operation not permitted" error.

Thanks.

TB0ne 12-04-2008 09:51 AM

Quote:

Originally Posted by elprawn (Post 3363553)
Hi. I have tomcat streaming files using one of my webapps, and if the file is from a certain directory on an external drive, I'd like to delete the file after streaming it, but tomcat needs root permissions to do so. I've tried changing the owner and permissions on the folder itself but it I get an "Operation not permitted" error.

Thanks.

Not alot of information to go on. Were you root when you tried to change owner/permissions on that directory? And you'll also have to change perms on the files too....

As root, run "chmod -R 777 <directory where your files are>". VERY unsafe, though, and to be used sparingly. I'd do a "chmod -R 755 <directory>", then change owners of the file(s) to be the tomcat user/group, which should let it delete those files.

elprawn 12-04-2008 10:32 AM

Quote:

Originally Posted by TB0ne (Post 3364382)
Not alot of information to go on. Were you root when you tried to change owner/permissions on that directory? And you'll also have to change perms on the files too....

As root, run "chmod -R 777 <directory where your files are>". VERY unsafe, though, and to be used sparingly. I'd do a "chmod -R 755 <directory>", then change owners of the file(s) to be the tomcat user/group, which should let it delete those files.

Those are basically the two things I tried, yeah. I opened a terminal as root, tried first doing "chmod 777 directory" (whilst the directory was empty), which didn't report any errors, but didn't actually change the permissions.

Then I tried "chown tomcat directory" and that one gave me an Operation not permitted error, even though I was trying it as root.

I have external windows computers adding files to the folder (it's on a samba share) and the files are automatically owned by root, so it's not really feasible to change the file permissions each time, because I want the files to be immediately accessible by tomcat.

elprawn 12-04-2008 02:25 PM

Problem solved. I unmounted the drive and remounted it with tomcat as the owner. Thanks for your time.


All times are GMT -5. The time now is 02:29 PM.