1

I'm using drush 7.x-4.5, Drupal 7.28, Apache 2.2.21, PHP 5.3.8. I have a multi-site installation, with a dozen or so sites, such as:

/path/to/drupal/sites/example1.com
/path/to/drupal/sites/example2.com
/path/to/drupal/sites/example3.com

Each of these is a symlink to some other location, which is not entirely uniform, e.g.:

example1.com -> /home/example1/drupal

...but another site might be:

example2.com -> /home/example2/www

If I run drush -r /path/to/drupal site-alias, I get a correct list of sites:

example1.com
example2.com
example3.com

However, if I then try to do something like drush -r /path/to-drupal @sites status, I get something unusable:

You are about to execute 'status' on all of the following targets:
  #drupal
  #www
  ...

So I can see it's just resolving the symlink and grabbing the last component of the path, then flattening that down to a set of unique last components of paths, which of course does not work at all.

I have tried filling out aliases with /etc/drush/aliases.drushrc.php, and while the aliases work in the single-site context (e.g. with $aliases['e1'] = array('root' => '/path/to/drupal', uri => 'example1.com'), the command drush /path/to/drupal@e1 status). The list that the @sites comes up with is unaffected.

Have I just set up this multi-site installation in an unusual way? It seems to otherwise be fine.

For what it's worth, I have a parallel Drupal 6 multi-site installation, and it has essentially the same problem.

0

The drush maintainers avoid multisite, so there is a possibility that some bugs might exist here. The version of Drush that you are using is very old, though; upgrading to Drush 6 would be advisable. @sites might even work for you then, as some work has been done for multisites and symlinks since Drush 4.

The best thing to do, however, would probably be to make an alias group. Make a file called /etc/drush/groupname.aliases.drushrc.php, and define aliases 'e1', etc. as you show above, one for each of your multisites, all in the same alias file. Then, simply:

drush @e1 status - show status on just one site

drush @groupname status - show status on all sites defined in the aliases file 'groupname'

  • Thank you for the suggestion. I didn't realize my version was that far out of date. I have upgraded to 6.3.0, the latest 6.x release, but it has the same behavior. I unfortunately can't test the 7.x branch due to the requirements. I'll try the group alias, assuming I can use the same thing for both of the D6 and D7 multi-sites, since they'll both be looking at /etc/drush. – HorsePunchKid May 31 '14 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.