mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add tljh_post_install hook
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
"""
|
||||
Simplest plugin that exercises all the hooks
|
||||
"""
|
||||
from textwrap import dedent
|
||||
|
||||
from tljh import systemd
|
||||
from tljh.hooks import hookimpl
|
||||
|
||||
|
||||
@@ -39,4 +42,22 @@ def tljh_config_post_install(config):
|
||||
|
||||
@hookimpl
|
||||
def tljh_custom_jupyterhub_config(c):
|
||||
c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator'
|
||||
c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator'
|
||||
|
||||
|
||||
@hookimpl
|
||||
def tljh_post_install():
|
||||
post_install_service = dedent("""
|
||||
[Unit]
|
||||
Description=Post Install Test Service
|
||||
|
||||
[Service]
|
||||
ExecStart=ls
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
""")
|
||||
service = "post-install-test.service"
|
||||
systemd.install_unit(service, post_install_service)
|
||||
systemd.enable_service(service)
|
||||
systemd.reload_daemon()
|
||||
|
||||
Reference in New Issue
Block a user