[Catalyst] Cached TT w/mod_perl issue? Or just a Toby-bug?

Toby Corkindale tjc at wintrmute.net
Tue Sep 6 12:33:55 CEST 2005


Hi,
I followed the instructions at
http://dev.catalyst.perl.org/wiki/IncreaseTTPerformance
to enable TTs caching of templates with the XS stash module.
(I also added a line to create the directory if it doesn't exist.)

I'm running Catalyst under mod_perl. After restarting apache, I see it has
created the directory (in /tmp/) as *root*, not Apache.

When I try to view any TT templates via my Catalyst app, it fails - the
relevant error being:
[catalyst] [error] Couldn't render template "mkdir /tmp/diesel_cache//home/tobyc/svn/DieselCatalyst/templates/cult: Permission denied at /usr/lib/perl5/vendor_perl/5.8.6/i686-linux/Template/Provider.pm line 844

However it has managed to build a small tree under that directory, namely:
/tmp/diesel_cache/home/tobyc/svn/DieselCatalyst/templates/base/
These directories are also owned by root.

I ran "chown -R apache:apache /tmp/diesel_cache" to make everything owned by
apache, and this solved the problem. Templates render.

I am guessing this is related to Apache running some initial startup stuff as
root, before it swaps over to the apache user. Is there a way around this to
provide a more elegant solution than just chown-ing the cache structure after
the first failure?
(I tried creating the /tmp/diesel_cache directory as owned by Apache, but the
subtree was still created as being owned by root)

Thanks,
Toby

-- 
Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --keyserver www.co.uk.pgp.net --recv-key B1CCF88E)



More information about the Catalyst mailing list