Originally mentioned here: http://drupal.org/node/1205458#comment-4891974

Moving sites/foo/files out of the Drupal root is a great for web clustering. We create an NFS partition at /var/lib/sitedata and symlink sites/aegir/$url/files to /var/lib/sitedata/aegir/$url/files.

For boost we also share the cache, and symlink cache to /var/lib/sitedata/aegir/$url/files.

This patch invokes a drush command hook when provision creates directories, allowing us to implement a hook that alter/override the creation of directories during _provision_drupal_create_directories().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

izmeez’s picture

subscribe

Steven Jones’s picture

Status: Needs review » Needs work
+++ b/platform/provision_drupal.drush.inc
@@ -237,6 +237,9 @@ function _provision_drupal_create_directories($url = NULL, $profile = NULL) {
+  drush_command_invoke_all('provision_drupal_create_directories', $mkdir, $url);

If this hook is for 'altering' the directories to be created, then it should be called so: 'provision_drupal_create_directories_alter'. Also, does drush_command_invoke_all pass the first argument around by reference, it looks like it might try to but, can you confirm that it does?

mrfelton’s picture

Does anyone have an example implementation of this hook that shows how it could be used to allow the files directory to live on a shared filesystem mountpoint?

halcyonCorsair’s picture

I've created a gist with all the relevant bits to make this work here:
https://gist.github.com/1585181

In this scenario, you have some shared storage mounted on your aegir server and any front end webservers at: /var/lib/sitedata (or even /var/lib/sitedata/aegir)

Ownership in my case: aegir:www-data (eg. <aegir user>:<aegir web group>) with group sticky permissions.

halcyonCorsair’s picture

mrfelton’s picture

This is pretty cool @halcyonCorsair . It's working to the point of moving stuff to the shared mount point, and setting up the symlinks. But when it comes to syncing stuff over to the remote cluster, only the symlinks get transferred and not the actual directories/files on the shared mount point.

mrfelton’s picture

By also making /var/lib/sitedata/aegir on the aegir server a gluster mount I got around the problem noted above.

halcyonCorsair’s picture

Yes, the aegir server itself needs the /var/lib/sitedata/aegir directory mounted as well. That's where the work gets done! :)

wamilton’s picture

Status: Needs work » Needs review

I'm confused: isn't the -h flag to tar exactly what we don't want for provision-backup?

Also, setting to needs review since that didn't happen when new patches and examples got added, and since I'm reviewing it. :)

anarcat’s picture

Status: Needs review » Needs work

Indeed, -h introduces a serious security vulnerability, see #1484214: [meta] migrate/clone performance optimizations for background information on this.

anarcat’s picture

For the record, I think it's okay to add that hook, just not to add a security vulnerability in the meantime. ;)

cweagans’s picture

Status: Needs work » Needs review
FileSize
608 bytes

Changes from #2 (add _alter).

Per last comment, I think this is okay now.

For the -h option, I think that could be configurable with a warning to the user about potential security issues. In my case, the entire Aegir environment is managed by trusted administrators, so the security issue is significantly less.

ergonlogic’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Needs work

I don't think this'll go in the 1.x branch, and the patch doesn't apply to 6.x-2.x.

cweagans’s picture

Status: Needs work » Needs review
FileSize
607 bytes

Reroll from head.

ergonlogic’s picture

Status: Needs review » Fixed

Fixed in 8793888

Status: Fixed » Closed (fixed)

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

  • Commit 8793888 on dev-drupal-8, 6.x-2.x, dev-ssl-ip-allocation-refactor, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by ergonlogic:
    Issue #1283738 by halcyonCorsair, cweagans: Allow other commands to add...