diff --git a/tljh/installer.py b/tljh/installer.py index ee5efe2..a6707ca 100644 --- a/tljh/installer.py +++ b/tljh/installer.py @@ -73,4 +73,4 @@ conda.ensure_conda_packages(USER_ENV_PREFIX, [ ]) systemd.reload_daemon() systemd.start_service('configurable-http-proxy') -systemd.start_service('jupyterhub') +systemd.restart_service('jupyterhub') diff --git a/tljh/systemd.py b/tljh/systemd.py index cef33e6..1951da7 100644 --- a/tljh/systemd.py +++ b/tljh/systemd.py @@ -46,3 +46,14 @@ def start_service(name): 'start', name ], check=True) + + +def restart_service(name): + """ + Restart service with given name. + """ + subprocess.run([ + 'systemctl', + 'restart', + name + ], check=True)