mirror of
http://junepve.top:3000/chicrobot/README.git
synced 2026-10-30 01:51:29 +08:00
更新 e1_linux添加systemd服务.md
This commit is contained in:
1 parent
acdf8fbcea
commit
d0d1551570
1 file changed
+10
-10
+10
-10
@@ -32,31 +32,31 @@ WantedBy=multi-user.target
|
|||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
# 开机自启(可选)
|
# 开机自启(可选)
|
||||||
sudo systemctl enable myblog.service
|
sudo systemctl enable pykins.service
|
||||||
|
|
||||||
# 启动服务
|
# 启动服务
|
||||||
sudo systemctl start myblog.service
|
sudo systemctl start pykins.service
|
||||||
```
|
```
|
||||||
|
|
||||||
## 相关命令
|
## 相关命令
|
||||||
```
|
```
|
||||||
# 启动
|
# 启动
|
||||||
sudo systemctl start myblog
|
sudo systemctl start pykins
|
||||||
# 停止
|
# 停止
|
||||||
sudo systemctl stop myblog
|
sudo systemctl stop pykins
|
||||||
# 重启
|
# 重启
|
||||||
sudo systemctl restart myblog
|
sudo systemctl restart pykins
|
||||||
# 查看状态
|
# 查看状态
|
||||||
sudo systemctl status myblog
|
sudo systemctl status pykins
|
||||||
```
|
```
|
||||||
查看日志
|
查看日志
|
||||||
```
|
```
|
||||||
# 实时跟踪日志(类似 tail -f)
|
# 实时跟踪日志(类似 tail -f)
|
||||||
sudo journalctl -u myapp.service -f
|
sudo journalctl -u pykins.service -f
|
||||||
# 查看该服务的所有日志
|
# 查看该服务的所有日志
|
||||||
sudo journalctl -u myapp.service
|
sudo journalctl -u pykins.service
|
||||||
# 查看今天的日志
|
# 查看今天的日志
|
||||||
sudo journalctl -u myapp.service --since today
|
sudo journalctl -u pykins.service --since today
|
||||||
# 按 SyslogIdentifier 过滤(需配置该项)
|
# 按 SyslogIdentifier 过滤(需配置该项)
|
||||||
sudo journalctl -t myapp
|
sudo journalctl -t pykins
|
||||||
```
|
```
|
||||||
Reference in new issue
Block a user