Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.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
Comment #3
Jon PughComment #4
helmo CreditAttribution: helmo at Initfour websolutions commentedLooks 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.
Comment #5
Jon PughNot 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
Comment #7
helmo CreditAttribution: helmo at Initfour websolutions commented@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.
Comment #8
Neograph734I will await this answer before committing to hosting DNS.
Comment #9
Jon PughWouldn'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.
Comment #10
Neograph734As 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.
Comment #11
Jon PughAhh 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)
Comment #12
Jon PughComment #13
Neograph734Thanks 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...
Comment #16
Jon PughI updated the docblock comments, mentioned it in both init_server() and symlink_service(), and added a @see to the Provision http class.
Merging!
Comment #18
Neograph734DNS has been updated as well :)
Comment #22
helmo CreditAttribution: helmo at Initfour websolutions commentednot perfect ... here's a follow up: #2917426: Move server's http service config symlinking again