From 893c54b79ed562efb70a9ab46d570123440ba9f6 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Wed, 27 Jun 2018 23:41:19 -0700 Subject: [PATCH] Mark systemd dependencies between chp / jupyterhub - Requires= makes success of CHP a hard dependency for JupyterHub - After= waits for CHP to start before jupyterhub starts - Start CHP after networking is ready (properly) --- tljh/systemd-units/configurable-http-proxy.service | 3 ++- tljh/systemd-units/jupyterhub.service | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tljh/systemd-units/configurable-http-proxy.service b/tljh/systemd-units/configurable-http-proxy.service index 772cd79..d05976d 100644 --- a/tljh/systemd-units/configurable-http-proxy.service +++ b/tljh/systemd-units/configurable-http-proxy.service @@ -1,7 +1,8 @@ # Template file for Configurable HTTP Proxy systemd service # Uses simple string.format() for 'templating' [Unit] -Wants=network-online.target +# Wait for network stack to be fully up before starting CHP +After=network.target [Service] User=root diff --git a/tljh/systemd-units/jupyterhub.service b/tljh/systemd-units/jupyterhub.service index 525b74b..f635bfd 100644 --- a/tljh/systemd-units/jupyterhub.service +++ b/tljh/systemd-units/jupyterhub.service @@ -1,7 +1,9 @@ # Template file for JupyterHub systemd service # Uses simple string.format() for 'templating' [Unit] -Wants=configurable-http-proxy.service +# CHP must have successfully started *before* we launch JupyterHub +Requires=configurable-http-proxy.service +After=configurable-http-proxy.service [Service] User=root