我已经用conda install在Ubuntu 16.04上安装了Jupyterhub。接下来,我通过在jupyterhub_config.py中添加以下内容使其使用oAuthenticator
from oauthenticator.github import GitHubOAuthenticator
c.JupyterHub.authenticator_class = GitHubOAuthenticator
c.GitHubOAuthenticator.create_system_users = True我还在~/.bashrc中添加了以下内容,并编写了源代码
#For OAuthentication
export GITHUB_CLIENT_ID=id
export GITHUB_CLIENT_SECRET=secret
export OAUTH_CALLBACK_URL=http://xyz:8000/hub/oauth_callback
export GIT_REPO_NAME=mmf
export GIT_BRANCH_NAME=master
export GITHUB_ACCESS_TOKEN= mytoken在启动jupyterhub之后,我可以看到"login with git“页面。现在,我已经通过创建/etc/systemd/system/jupyterhub.service并向其中添加以下内容,将jupyterhub配置为作为服务运行
[Unit]
Description=Starts JupyterHub as Daemon
After=syslog.target network.target
[Service]
User=root
Environment=”PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/etc/Applications/Anaconda3/bin”
ExecStart=/etc/Applications/Anaconda3/bin/jupyterhub –f /etc/Applications/JupyterHub/jupyterhub_config.py
[Install]
WantedBy=multi-user.target现在,我使用systemctl start jupyterhub启动它,但是现在我得到的是常规登录页面,而不是git登录页面。
这可能是因为它没有读取jupyterhub_config.py。我检查了jupyterhub.service中提到的所有目录,它们都被检查出来了。
Anaconda安装目录: /etc/Applications/Anaconda3/
Jupyterhub配置文件目录: /etc/Applications/JupyterHub/jupyterhub_config.py
有人能帮我吗?
发布于 2019-02-06 18:18:40
使用以下命令启动Jupyterhub:
jupyterhub -f /etc/Applications/JupyterHub/jupyterhub_config.py
在你的情况下,我猜一定是
systemctl start jupyterhub -f /etc/Applications/JupyterHub/jupyterhub_config.py
用于单据参照
https://stackoverflow.com/questions/54548376
复制相似问题