Back in the day, provision_civicrm used to set the template_c and ConfigAndLog directory to a 'drush' subdirectory. The code is still there, but I think that due to drush/aegir upgrades, that init function isn't called anymore.

As a consequence, if we run a drush command that causes CiviCRM to generate files in the template_c cache, we're then likely to run into a file permission problem where www-data will not be able to write in the template_c directory, for example.

However, the initial solution to use a sub-directory was not ideal. For example, it breaks "drush cvapi System.flush", since then the template_c wouldn't be correctly purged.

The best solution seems to be to use Linux ACLs:
https://civicrm.stackexchange.com/questions/2923/civicrm-does-not-have-p...

Comments

xurizaemon’s picture

Status: Active » Needs review
StatusFileSize
new613 bytes

I spun up a few sites in Aegir 3 today, and noticed this:

aegir@littlethunder:/tmp$ ls -lAF /var/aegir/platforms/p1/sites/s1.example.org/files/civicrm/
total 20
drwxrwxr-x 2 aegir aegir    4096 Jul 21 05:33 ConfigAndLog/
drwxrws--- 2 aegir www-data 4096 Jul 21 05:33 custom/
drwxrws--- 3 aegir www-data 4096 Jul 21 05:33 persist/
drwxrws--- 3 aegir www-data 4096 Jul 21 05:33 templates_c/
drwxrws--- 2 aegir www-data 4096 Jul 21 05:33 upload/

This (www-data can't write to sites/*/files/civicrm/ConfigAndLog/*) causes notices on CiviCRM pages, but is easily resolved with a small patch to set perms on ConfigAndLog also.

  • bgm committed 580cd22 on 6.x-2.x authored by xurizaemon
    Issue #2499723. Apply permissions to files/civicrm/ConfigAndLog also.
    
bgm’s picture

Thanks, patch applied to 6.x-2.x (which works with Aegir3 as well).

Although I haven't done proper testing to make sure it 100% solves the issues, so will leave the issue open for now.

xurizaemon’s picture

Yep, I don't think #1 actually addresses the issue description, just the right issue to file a triviapatch under :)