# HG changeset patch # User Luke Hoersten # Date 1660011401 18000 # Node ID b31ef0e10cada6f87c33ee5db5a79055a7c0c72f # Parent b4ce6f1f15b7cb7e29a6d15abeb0313d69ffc89e Added Dendrite symlink to port workaround. diff -r b4ce6f1f15b7 -r b31ef0e10cad dendrite/server/handlers/main.yaml --- a/dendrite/server/handlers/main.yaml Mon Aug 08 16:12:44 2022 -0500 +++ b/dendrite/server/handlers/main.yaml Mon Aug 08 21:16:41 2022 -0500 @@ -2,4 +2,4 @@ - name: restart service become: yes - systemd: name="dendrite@{{dendrite_instance}}.service" state="restarted" daemon_reload="yes" + systemd: name="dendrite@{{dendrite_port}}.service" state="restarted" daemon_reload="yes" diff -r b4ce6f1f15b7 -r b31ef0e10cad dendrite/server/tasks/main.yaml --- a/dendrite/server/tasks/main.yaml Mon Aug 08 16:12:44 2022 -0500 +++ b/dendrite/server/tasks/main.yaml Mon Aug 08 21:16:41 2022 -0500 @@ -50,7 +50,6 @@ - {"src": "dendrite-upgrade-tests" , "dest": "dendrite-upgrade-tests"} - {"src": "generate-config" , "dest": "dendrite-generate-config"} - {"src": "generate-keys" , "dest": "dendrite-generate-keys"} - - {"src": "goose" , "dest": "dendrite-goose"} - {"src": "resolve-state" , "dest": "dendrite-resolve-state"} - name: create instance dir @@ -66,6 +65,17 @@ - "{{dendrite_dir}}" - "{{dendrite_dir}}/{{dendrite_instance}}" +- name: create instance port symlink + become: yes + file: + src: "{{dendrite_dir}}/{{dendrite_instance}}" + dest: "{{dendrite_dir}}/{{dendrite_port}}" + state: "link" + owner: "{{dendrite_user}}" + group: "{{dendrite_user}}" + mode: "0755" + notify: restart service + - name: install keys become: yes copy: @@ -107,6 +117,10 @@ src: "dendrite@.service.j2" dest: "/lib/systemd/system/dendrite@.service" +- name: ensure instance service is stopped + become: yes + systemd: name="dendrite@{{dendrite_instance}}.service" enabled="no" state="stopped" daemon_reload="yes" + - name: ensure service is started become: yes - systemd: name="dendrite@{{dendrite_instance}}.service" enabled="yes" state="started" + systemd: name="dendrite@{{dendrite_port}}.service" enabled="yes" state="started" diff -r b4ce6f1f15b7 -r b31ef0e10cad dendrite/server/templates/dendrite@.service.j2 --- a/dendrite/server/templates/dendrite@.service.j2 Mon Aug 08 16:12:44 2022 -0500 +++ b/dendrite/server/templates/dendrite@.service.j2 Mon Aug 08 21:16:41 2022 -0500 @@ -1,10 +1,10 @@ [Unit] -Description=Dendrite %I Instance +Description=Dendrite instance on port %i After=syslog.target network.target postgresql.service [Service] WorkingDirectory={{dendrite_dir}}/%i/ -ExecStart=/usr/local/bin/dendrite-monolith-server -config "{{dendrite_dir}}/%i/dendrite.yaml" -http-bind-address ":{{dendrite_port}}" +ExecStart=/usr/local/bin/dendrite-monolith-server -config "{{dendrite_dir}}/%i/dendrite.yaml" -http-bind-address ":%i" Restart=always User={{dendrite_user}} LimitNOFILE=65535