網站首頁 編程語言 正文
1 創建JupyterLab運行腳本
首先找到jupyter-lab命令的位置,一般在~/.local/bin/下,可以創建shell腳本autoJupyterLab.sh:
#!/bin/sh
/home/myjetson/.local/bin/jupyter-lab
測試一下腳本的正確性::
./autoJupyterLab.sh
遠程連接JupyterLab成功,說明運行腳本沒問題。
2 添加JupyterLab Service文件
Ubuntu18通過systemd管理服務,因此添加服務來開機運行JupyterLab腳本。
服務Service保存在/lib/systemd/system和/etc/systemd/system下。在/etc/systemd/system下創建auto-jupyter.service服務:
[Unit]
Description=Auto Load JupyterLab
After=network.target
[Service]
Type=simple
User=your_username
ExecStart=/your_script_dir/autoJupyterLab.sh
Restart=on-failure
RestartSec=15s
[Install]
WantedBy=multi-user.target
3 設置Jupyter Service自啟動
讓systemd重新加載service文件:
sudo systemctl daemon-reload
然后設置auto-jupyter.service開機自啟:
sudo systemctl enable auto-jupyter.service
這樣配置就完成了。
4 測試自啟動服務
試著手動運行auto-jupyter.service,看看服務寫的有沒有問題:
sudo systemctl start auto-jupyter.service
sudo systemctl status auto-jupyter.service
重啟服務器,遠程連接jupyterlab,大功告成!
原文鏈接:https://blog.csdn.net/weixin_52201738/article/details/128901779
相關推薦
- 2022-04-23 css3新特性transition初體驗
- 2024-02-28 CSS,文本溢出顯示省略號
- 2023-02-17 Python運算符優先級詳細整理_python
- 2023-07-30 el-selete改變值后選中的內容不變
- 2022-07-21 SystemVerilog中使用string所遇到的問題
- 2023-01-21 python?flask自定義404錯誤頁面方式_python
- 2022-12-24 Python中通過@classmethod?實現多態的示例_python
- 2022-05-17 bat批處理之字符串操作的實現_DOS/BAT
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支