From 2a8c056a3bdf5879c191e13114045616bfe57912 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Thu, 9 May 2019 13:13:04 -0700 Subject: [PATCH] Run hub db migrations if needed before starting hub --- tljh/systemd-units/jupyterhub.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tljh/systemd-units/jupyterhub.service b/tljh/systemd-units/jupyterhub.service index e766e20..6412a81 100644 --- a/tljh/systemd-units/jupyterhub.service +++ b/tljh/systemd-units/jupyterhub.service @@ -17,6 +17,9 @@ PrivateDevices=yes ProtectKernelTunables=yes ProtectKernelModules=yes Environment=TLJH_INSTALL_PREFIX={install_prefix} +# Run upgrade-db before starting, in case Hub version has changed +# This is a no-op when no db exists or no upgrades are needed +ExecStartPre={python_interpreter_path} -m jupyterhub.app -f {jupyterhub_config_path} upgrade-db ExecStart={python_interpreter_path} -m jupyterhub.app -f {jupyterhub_config_path} [Install]