Thursday, November 6, 2014

Re: Dango signal can't delete directory

I added:

    try:
        mode = os.stat(path).st_mode
        print(str(S_ISDIR(mode)))
    except Exception, e:
        print("Error stating tile cache %s" % str(e))
 
Which gives:

Error stating tile cache [Errno 2] No such file or directory: '/tmp/tile_cache/mike'

But ls -al /tmp/tile_cache shows the "mike" directory clearly exists. So I'm assuming the Python code under Apache can't stat the directory.

ls /tmp/tile_cache -al 
total 0
drwxr-xr-x  3 apache apache   60 Nov  6 11:07 .
drwxrwxrwt 58 root   root   1380 Nov  6 11:07 ..
drwxrwxrwx  2 apache apache  860 Nov  6 11:07 mike

Oh but I just noticed that the total is '0'. Weird.


On Thursday, 6 November 2014 11:02:15 UTC-5, Stodge wrote:
I'll see if the python code under Apache can stat /tmp. Thanks.

On Thursday, 6 November 2014 10:56:39 UTC-5, Tom Evans wrote:
On Thu, Nov 6, 2014 at 3:54 PM, Tom Evans <teva...@googlemail.com> wrote:
> On Thu, Nov 6, 2014 at 3:08 PM, Stodge <sto...@gmail.com> wrote:
>> I have a separate daemon running as root that generates cached image tiles
>> per user for a map. For now it creates them under /tmp/tile_cache. When it
>> creates a new tile cache it changes the UID and GID to the apache user (on
>> Fedora)

Oops, missed that bit!

Can you run stat as the user running the deletion for each component
in the path up to /tmp.

Eg, if it is /tmp/tile_cache/1234/567:

stat /tmp
stat /tmp/tile_cache
stat /tmp/tile_cache/1234

etc

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6f75b032-4ef7-4b72-b8b0-52031da74709%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment