2018-06-26 18:37:24 -07:00
|
|
|
# Template file for JupyterHub systemd service
|
|
|
|
|
# Uses simple string.format() for 'templating'
|
|
|
|
|
[Unit]
|
2019-01-22 16:24:38 +02:00
|
|
|
# Traefik must have successfully started *before* we launch JupyterHub
|
|
|
|
|
Requires=traefik.service
|
|
|
|
|
After=traefik.service
|
2018-06-26 18:37:24 -07:00
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
User=root
|
|
|
|
|
Restart=always
|
2018-07-18 23:15:36 -07:00
|
|
|
WorkingDirectory={install_prefix}/state
|
2018-06-27 02:00:52 -07:00
|
|
|
# Protect bits that are normally shared across the system
|
|
|
|
|
PrivateTmp=yes
|
|
|
|
|
PrivateDevices=yes
|
|
|
|
|
ProtectKernelTunables=yes
|
|
|
|
|
ProtectKernelModules=yes
|
|
|
|
|
Environment=TLJH_INSTALL_PREFIX={install_prefix}
|
2023-05-16 13:23:25 +02:00
|
|
|
Environment=PATH={install_prefix}/hub/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
2019-05-09 13:13:04 -07:00
|
|
|
# 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
|
2019-05-20 11:31:33 -07:00
|
|
|
ExecStart={python_interpreter_path} -m jupyterhub.app -f {jupyterhub_config_path} --upgrade-db
|
2018-06-28 00:49:36 -07:00
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
# Start service when system boots
|
|
|
|
|
WantedBy=multi-user.target
|