Follow-on to #2020075: Refactor subdirs to use proper Config class(es):

From my testing, the symlink on Drupal 6 platforms isn't being created. But it's otherwise working very nicely.

CommentFileSizeAuthor
#3 Subdirectory-alias.txt13.82 KBomega8cc

Comments

anarcat’s picture

Status: Active » Postponed (maintainer needs more info)

this is really weird - i did my tests on both d6 and d7, and there is no version-specific code in there... all the action happens in subdirs.drush.inc, which should handle both similarly.

so as things stand, I can't reproduce - can you give us the task log? it should say something about creating a symlink if it hits the hook...

omega8cc’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active

On site install the task log says:

Subdirectory alias `sub.master.ocean.nyc.host8.biz/bar` found. Creating magic symlinks. symlinked sites/sub.master.ocean.nyc.host8.biz.bar to bar.sub.master.ocean.nyc.host8.biz

But it *doesn't* create that symlink:

ocean:/var/aegir/host_master/033/sites# ls -la
total 24K
drwxr-x--x 6 aegir aegir 4.0K Dec 31 16:16 ./
drwxr-xr-x 8 aegir aegir 4.0K Dec 28 20:23 ../
drwxr-x--x 6 aegir aegir 4.0K Dec 30 21:47 all/
drwxr-xr-x 7 aegir aegir 4.0K Dec 31 16:16 bar.sub.master.ocean.nyc.host8.biz/
drwxr-xr-x 2 aegir aegir 4.0K Dec 28 20:23 default/
drwxr-xr-x 7 aegir aegir 4.0K Dec 30 19:41 foo.sub.master.ocean.nyc.host8.biz/
lrwxrwxrwx 1 aegir aegir   34 Dec 31 16:11 sub.master.ocean.nyc.host8.biz.foo -> foo.sub.master.ocean.nyc.host8.biz/

It is probably because it fails to replace "/" with "." which is confirmed by a wrong alias written in the vhost:

server_name bar.sub.master.ocean.nyc.host8.biz sub.master.ocean.nyc.host8.biz/bar;

However, once your run Verify task, the symlink is created:

ocean:/var/aegir/host_master/033/sites# ls -la
total 24K
drwxr-x--x 6 aegir aegir 4.0K Dec 31 16:24 ./
drwxr-xr-x 8 aegir aegir 4.0K Dec 28 20:23 ../
drwxr-x--x 6 aegir aegir 4.0K Dec 30 21:47 all/
drwxr-xr-x 7 aegir aegir 4.0K Dec 31 16:16 bar.sub.master.ocean.nyc.host8.biz/
drwxr-xr-x 2 aegir aegir 4.0K Dec 28 20:23 default/
drwxr-xr-x 7 aegir aegir 4.0K Dec 30 19:41 foo.sub.master.ocean.nyc.host8.biz/
lrwxrwxrwx 1 aegir aegir   34 Dec 31 16:24 sub.master.ocean.nyc.host8.biz.bar -> bar.sub.master.ocean.nyc.host8.biz/
lrwxrwxrwx 1 aegir aegir   34 Dec 31 16:11 sub.master.ocean.nyc.host8.biz.foo -> foo.sub.master.ocean.nyc.host8.biz/

Still, the vhost is not updated with correct alias, so Nginx complains with warning:

2013/12/31 16:24:04 [warn] 21692#0: server name "sub.master.ocean.nyc.host8.biz/bar" has suspicious symbols in /var/aegir/config/server_master/nginx/vhost.d/bar.sub.master.ocean.nyc.host8.biz:13
2013/12/31 16:24:04 [warn] 21692#0: server name "sub.master.ocean.nyc.host8.biz/foo" has suspicious symbols in /var/aegir/config/server_master/nginx/vhost.d/foo.sub.master.ocean.nyc.host8.biz:13

Furthermore, the wildcard include is wrong, because it causes all site specific includes to be included in all subdir-based vhosts:

include /var/aegir/config/server_master/nginx/subdir.d/sub.master.ocean.nyc.host8.biz/*.conf;

This causes critical error and mixes db credentials:

2013/12/31 16:24:04 [emerg] 21692#0: duplicate location "/" in /var/aegir/config/server_master/nginx/subdir.d/sub.master.ocean.nyc.host8.biz/foo.conf:489

However, it is slightly separate issue I plan to fix. Scratch that last part, it does have to use wildcard, because there is just one vhost. I need to improve Nginx magic, it seems.

omega8cc’s picture

StatusFileSize
new13.82 KB

Hmm, I should have read a complete install log. It creates and then deletes that symlink:

Subdirectory alias `sub.master.ocean.nyc.host8.biz/bar` found. Creating magic symlinks. symlinked sites/sub.master.ocean.nyc.host8.biz.bar to bar.sub.master.ocean.nyc.host8.biz

Removed symlink for alias /var/aegir/host_master/033/sites/sub.master.ocean.nyc.host8.biz.bar Could not create symlink for alias bar.sub.master.ocean.nyc.host8.biz (The symlink could not be created, an error has occured)

omega8cc’s picture

In short, it looks like there is some confusion between source and target, or between the site directory and the alias/symlink, if it says symlink for alias bar.sub.master.ocean.nyc.host8.biz, while bar.sub.master.ocean.nyc.host8.biz is not an alias, it is a site name and a site's *directory* name.

omega8cc’s picture

It seems that function _provision_drupal_maintain_aliases() is not aware of the subdir specifics?

[EDIT] I mean, Provision can be confused by an alias which contains "/".

omega8cc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

  • Commit 23dc6c2 on 6.x-2.x, 7.x-3.x, 6.x-2.x-backports, dev-helmo-3.x by omega8cc:
    Issue #2100181 by ergonlogic - Symlink missing for D6 subdir sites.