国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

ubuntu開機自啟動服務設置

瀏覽:251日期:2023-03-07 14:40:10

在ubuntu 下創建服務及自啟動的方法:

1. 在 [/lib/systemd/system] 創建sandtable.service 服務,

[Unit]
Description=/etc/sandtable Compatibility
Documentation=man:systemd-sandtable-generator(8)
ConditionFileIsExecutable=/etc/sandtable
After=network.target
 
[Service]
Type=forking
ExecStart=/etc/sandtable start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
 
[Install]
WantedBy=multi-user.target  
Alias=sandtable.service

2. 創建啟動腳本

在[/etc]文件夾下創建sandtable啟動腳本,切記加上[腳本后&], 保證服務不影響系統啟動,不然那可能導致系統無法正常啟動后果。

#!/bin/sh
/home/ubuntu/setup >> /home/ubuntu/test.log&

3. 啟動服務

systemctl start sandtable.service #啟動服務
 
systemctl status sandtable.service #查看服務是否啟動
 
systemctl enable sandtable.service #開機運行服務
 
systemctl is-enabled sandtable.service #查詢服務是否開機啟動

4 服務常用命令

systemctl is-enabled servicename.service #查詢服務是否開機啟動
 
systemctl enable *.service #開機運行服務
 
systemctl disable *.service #取消開機運行
 
systemctl start *.service #啟動服務
 
systemctl stop *.service #停止服務
 
systemctl restart *.service #重啟服務
 
systemctl reload *.service #重新加載服務配置文件
 
systemctl status *.service #查詢服務運行狀態

5.桌面系統的開啟與關閉

// 關閉桌面系統
sudo systemctl set-default multi-user.target
sudo reboot
 
// 打開桌面系統
sudo systemctl set-default graphical.target
sudo reboot

6. 桌面版設置的wifi 在下邊路徑進行修改替換即可

 /etc/NetworkManager/system-connections

到此這篇關于ubuntu開機自啟動服務設置的文章就介紹到這了,更多相關ubuntu開機自啟動內容請搜索以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持!

標簽: Linux Apache
主站蜘蛛池模板: 永修县| 息烽县| 内丘县| 桐城市| 四川省| 岳阳市| 利津县| 永和县| 灵宝市| 西宁市| 廊坊市| 通化市| 湖州市| 县级市| 天水市| 清涧县| 兴仁县| 湖州市| 五常市| 榆林市| 安宁市| 南投市| 平乡县| 得荣县| 蛟河市| 福安市| 封开县| 滁州市| 通榆县| 太白县| 紫云| 竹北市| 克山县| 疏勒县| 武乡县| 石阡县| 泊头市| 大兴区| 长兴县| 亳州市| 舞阳县|