Problem/Motivation

we have a system user, aegir
the user is part of the www-data group
but the user cannot create directories
thus we get a WSOD

filecache creates directories and writes files as www-data:www-data

My sites are owned by a user, aegir.

Drush commands are also done under aegir.

After enabling filecache, drush no longer works. Why?

Drush attempts to write to cache as the aegir user and is denied

Is there a way for aegir user to create files in a directory owned by www-data and write it as www-data. The aegir user is part of www-data group.

It can't be a manual process because the owners will change and possibly take down the site

This is a different issue but they had a fix - https://www.drupal.org/project/google_tag/issues/3159778#comment-14047515

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

SocialNicheGuru created an issue. See original summary.

socialnicheguru’s picture

socialnicheguru’s picture

Issue summary: View changes
socialnicheguru’s picture

Changed permission to allow group to write to file also

socialnicheguru’s picture

StatusFileSize
new579 bytes
pfrenssen’s picture

I see that both users are a member of the www-data group. You can solve it by setting this group as the owner of the cache folder, and assign the "setgid" bit so that all newly created files will inherit the group from the parent.

Something like this (not tested):

# Set the "www-data" group as the owner of the cache folder
$ chgrp -R www-data /var/cache/my_filecache_folder

# Set the "setgid" bit so that newly created files inherit the group.
$ chmod -R u+rwx,g+srwx /var/cache/my_filecache_folder
pfrenssen’s picture

Status: Active » Reviewed & tested by the community

Actually I think the suggested patch makes sense in a lot of situations. It is a common scenario that a group is created for the webserver and that other services join this group.

pfrenssen’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.