aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/systemd')
-rw-r--r--packaging/systemd/meshbay-hub.service9
1 files changed, 8 insertions, 1 deletions
diff --git a/packaging/systemd/meshbay-hub.service b/packaging/systemd/meshbay-hub.service
index 40cdb98..1a3ca44 100644
--- a/packaging/systemd/meshbay-hub.service
+++ b/packaging/systemd/meshbay-hub.service
@@ -16,7 +16,14 @@ EnvironmentFile=-/etc/meshbay/hub.env
Environment=MESHBAY_DATABASE_URL=postgresql+asyncpg://meshbay:CHANGEME@localhost/meshbay_hub
Environment=MESHBAY_HUB_KEY=/etc/meshbay/hub_private.pem
-ExecStartPre=/opt/meshbay-common/venv/bin/alembic -c /opt/meshbay-hub/migrations/alembic.ini upgrade head
+# The hub's own command, not `alembic -c <a path>`. That path was
+# /opt/meshbay-hub/migrations/alembic.ini, where `%(here)s/src/meshbay_hub/db/…`
+# resolves to a directory the package does not install — the migrations ship
+# inside meshbay_hub itself, in the shared venv. So this line could never
+# succeed, and a hub installed from the RPM or the DEB would not start at all.
+# `migrate` asks the installed package where its own migrations are, which is
+# correct for the package, a venv, and a checkout alike.
+ExecStartPre=/opt/meshbay-common/venv/bin/meshbay-hub migrate --config /etc/meshbay/hub.toml
ExecStart=/opt/meshbay-common/venv/bin/meshbay-hub --config /etc/meshbay/hub.toml
Restart=always
RestartSec=5