mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
ensure state dir exists before putting files in it
This commit is contained in:
@@ -112,6 +112,9 @@ def ensure_jupyterhub_service(prefix):
|
|||||||
"""
|
"""
|
||||||
Ensure JupyterHub Services are set up properly
|
Ensure JupyterHub Services are set up properly
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
os.makedirs(STATE_DIR, mode=0o700, exist_ok=True)
|
||||||
|
|
||||||
with open(os.path.join(HERE, 'systemd-units', 'jupyterhub.service')) as f:
|
with open(os.path.join(HERE, 'systemd-units', 'jupyterhub.service')) as f:
|
||||||
hub_unit_template = f.read()
|
hub_unit_template = f.read()
|
||||||
|
|
||||||
@@ -133,8 +136,6 @@ def ensure_jupyterhub_service(prefix):
|
|||||||
systemd.install_unit('traefik.service', traefik_unit_template.format(**unit_params))
|
systemd.install_unit('traefik.service', traefik_unit_template.format(**unit_params))
|
||||||
systemd.reload_daemon()
|
systemd.reload_daemon()
|
||||||
|
|
||||||
os.makedirs(STATE_DIR, mode=0o700, exist_ok=True)
|
|
||||||
|
|
||||||
# Set up proxy / hub secret oken if it is not already setup
|
# Set up proxy / hub secret oken if it is not already setup
|
||||||
proxy_secret_path = os.path.join(STATE_DIR, 'configurable-http-proxy.secret')
|
proxy_secret_path = os.path.join(STATE_DIR, 'configurable-http-proxy.secret')
|
||||||
if not os.path.exists(proxy_secret_path):
|
if not os.path.exists(proxy_secret_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user