Skip to content

Commit 7563b2a

Browse files
AndrewFerrsandhose
andauthored
configure_workers_and_start.py: unify python path (#18291)
Use absolute path for python in script shebang, and invoke child python processes with sys.executable. This is consistent with the absolute path used to invoke python elsewhere (like in the supervisor config). ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: Quentin Gliech <[email protected]>
1 parent 4097ada commit 7563b2a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.d/18291.docker

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In configure_workers_and_start.py, use the same absolute path of Python in the interpreter shebang, and invoke child Python processes with `sys.executable`.

docker/configure_workers_and_start.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/local/bin/python
22
#
33
# This file is licensed under the Affero General Public License (AGPL) version 3.
44
#
@@ -604,7 +604,7 @@ def generate_base_homeserver_config() -> None:
604604
# start.py already does this for us, so just call that.
605605
# note that this script is copied in in the official, monolith dockerfile
606606
os.environ["SYNAPSE_HTTP_PORT"] = str(MAIN_PROCESS_HTTP_LISTENER_PORT)
607-
subprocess.run(["/usr/local/bin/python", "/start.py", "migrate_config"], check=True)
607+
subprocess.run([sys.executable, "/start.py", "migrate_config"], check=True)
608608

609609

610610
def parse_worker_types(

0 commit comments

Comments
 (0)