Possible fix for errors in drush cron run

psynaptic - June 22, 2009 - 08:31
Project:Cache Router
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I've been getting some permissions errors when running:

$ drush cron

user@example.clustered.net: ~/public_html> drush cron
Cron run successfully.
warning:                                                             [warning]
fopen(/tmp/filecache/api/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables):
failed to open stream: Permission denied in
/home/api/domains/example.com/public_html/sites/all/modules/cacherouter/engines/file.php
on line 150.
warning:                                                             [warning]
fopen(/tmp/filecache/api/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables):
failed to open stream: Permission denied in
/home/api/domains/example.com/public_html/sites/all/modules/cacherouter/engines/file.php
on line 150.
warning:                                                             [warning]
fopen(/tmp/filecache/api/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables):
failed to open stream: Permission denied in
/home/api/domains/example.com/public_html/sites/all/modules/cacherouter/engines/file.php
on line 150.
warning:                                                             [warning]
fopen(/tmp/filecache/api/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables):
failed to open stream: Permission denied in
/home/api/domains/example.com/public_html/sites/all/modules/cacherouter/engines/file.php
on line 150.
warning:                                                             [warning]
fopen(/tmp/filecache/api/cache/8/87cd8b8808600624d8c590cfc2e6e94b--variables):
failed to open stream: Permission denied in
/home/api/domains/example.com/public_html/sites/all/modules/cacherouter/engines/file.php
on line 150.

I first added the current user to the apache group and tried again but this didn't work as drush seems to be running cron as an Anonymous user.

The only "fix" I could find, and this might not be the best approach, was to chmod all created dirs and files to 777.

Patch attached for testing.

AttachmentSize
cacherouter_perms-.patch1.07 KB
 
 

Drupal is a registered trademark of Dries Buytaert.