Deep within the Provision_Config_Http_Server class is a little piece of code that inserts a symlink on each server from /var/aegir/config/SERVICE.conf to /var/aegir/config/server_NAME/SERVICE.conf.

I am working on docker services, and I am altering the server alias to think it is localhost because we cannot SSH into a container.

This is causing the symlink to be created on server master. This is a problem because many docker servers will be added, overwriting each others config.

I need to prevent the symlinking in my service class, so the attached patch and branch moves the code for symlinking to a method on the Provision_Service_http_public class, which is where the original Provision_Config_Http_Server get loaded.

Comments

Jon Pugh created an issue. See original summary.

  • Jon Pugh committed 71ec853 on 2851478-move-symlink
    Issue #2851478: Move the symlinking of service config from the...
Jon Pugh’s picture

helmo’s picture

Looks simple enough :) and the service implementation is a better place for that code anyway.

I did notice though that hosting_dns also relies on such a symlink so we'd have to add it there too. What if we moved the implemetation two levels up in the chain ... to Provision_Service ? Then both would have it.

Jon Pugh’s picture

Not sure... Seems like very few services would ever use a symlink like this but I could be wrong?

I defer to you, all I care about is being able to prevent that symlink from being written :D

  • helmo committed 3ec592a on 2851478-move-symlink
    Issue #2851478: Move symlink code  up two levels to Provision_Service
    
helmo’s picture

@Jon Pugh, Please test if this still has the desired effect ...

I've prepared a patch for hosting_dns in #2855368: Move symlink call to match provision update.

Neograph734’s picture

I will await this answer before committing to hosting DNS.

Jon Pugh’s picture

Wouldn't we end up with a ton of symlinks, one for every service, only a few services need it.

We could use a small intermediary class for any services that actually manipulate config files and need the symlinks... Web, DNS, Solr, and now docker all need symlinks. The database services, git services, and the rest do not.

Neograph734’s picture

As long as the services that do not need it do not call $this->symlink_service();, nothing should happen right?

So this would already work for only those services that need it.

Jon Pugh’s picture

Ahh of course..

Then this looks great, but let's document it more.

Can you add a comment on the method on the recommended place to implement?(which is Init_server() I think)

Jon Pugh’s picture

Status: Needs review » Reviewed & tested by the community
Neograph734’s picture

Thanks Jon.

helmo, could you to that? I do not believe that I have git access and uploading a patch here for a one-line comment seems a bit useless...

  • helmo committed d3ee3dc on 2851478-move-symlink
    Issue #2851478: Add comment
    

  • Jon Pugh committed fc6ef6b on 2851478-move-symlink
    Issue #2851478: Improving comments to explain to developers how to use...
Jon Pugh’s picture

Status: Reviewed & tested by the community » Fixed

I updated the docblock comments, mentioned it in both init_server() and symlink_service(), and added a @see to the Provision http class.

Merging!

  • helmo committed 3ec592a on 7.x-3.x
    Issue #2851478: Move symlink code  up two levels to Provision_Service
    
  • Jon Pugh committed 71ec853 on 7.x-3.x
    Issue #2851478: Move the symlinking of service config from the...
  • helmo committed d3ee3dc on 7.x-3.x
    Issue #2851478: Add comment
    
  • Jon Pugh committed fc6ef6b on 7.x-3.x
    Issue #2851478: Improving comments to explain to developers how to use...
Neograph734’s picture

DNS has been updated as well :)

  • Jon Pugh committed 6d627ac on 7.x-3.x
    Issue #2851478: Log a "success" message when creating a symlink.
    

  • Jon Pugh committed 2745606 on 7.x-3.x
    Issue #2851478: Log a "notice" message when creating a symlink, not a...

Status: Fixed » Closed (fixed)

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

helmo’s picture