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

Matt S Trout dbix-class at trout.me.uk
Fri Sep 23 18:07:58 CEST 2005


On Fri, Sep 23, 2005 at 03:46:17PM +0100, Toby Corkindale wrote:
> Hi, I just wondered if anyone had any thoughts on the below problem?
> It basically just comes down to this issue:
> 1) apache w/mod_perl starts up, running as root, and initialises some parts of
> the Catalyst system.
> 2) TT's cache directory is created as root, and a tree is created underneath
> it, also owned by root.
> 3) Apache setuid()s to the apache user
> 4) Catalyst can no-longer write to the TT cache directory, as it has
> insufficient permissions.
> 
> 
> I can work around this by doing a chown apache of the Catalyst cache dir
> during startup, but this seems poor form.. Plus requires to know what the
> apache user's name is in advance, which potentially varies between
> distributions.
> 
> Is there a more sensible way to do this?
> 
> Note that using $> doesn't work, as you have already set the TT cache dir in
> the config during the initialisation as root (euid=0), before the setuid
> occurs.

Delay MyApp->setup until a PerlChildInitHandler?

Or have the TT cache dir set to a *group* apache can write to and setgid
so the permissions propagate so group write sorts the problem.

-- 
     Matt S Trout       Specialists in perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list