Last active
October 9, 2019 06:46
-
-
Save npyoung/b10dcbd258787ef8cf06ad558450abf8 to your computer and use it in GitHub Desktop.
Run jupyter lab as a userspace service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place this in ~/.config/systemd/user | |
[Unit] | |
Description=Code Server IDE | |
After=network.target | |
[Service] | |
Type=simple | |
EnvironmentFile=/home/ubuntu/.profile | |
WorkingDirectory=/home/ubuntu | |
Restart=on-failure | |
RestartSec=10 | |
ExecStart=/home/ubuntu/bin/code-server --no-auth --port 8080 /home/ubuntu | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run these lines in the terminal | |
sudo loginctl enable-linger "$USER"; | |
for svc in "jupyterlab" "codeserver"; do | |
systemctl --user enable $svc; | |
systemctl --user start $svc; | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place this in ~/.config/systemd/user | |
[Unit] | |
Description=Service to run JupyterLab in user space | |
[Service] | |
Type=simple | |
ExecStart=/bin/bash -c "source ~/.profile; eval jupyter-lab" | |
WorkingDirectory=/home/ubuntu | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment