开机自启动
2024-01-14 本文已影响0人
xueyueshuai
systemctl status xxx [-l]
systemctl start xxx
systemctl stop xxx
systemctl restart xxx
systemctl enable xxx 开机自启动
systemctl disabel xxx 取消开机自启动
文件路径 /etc/systemd/system/xxx.service
[Unit]
# 服务名称,可自定义
Description = xxx
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动的命令
ExecStart = /home/xueyueshuai/xxx-start.sh
[Install]
WantedBy = multi-user.target
sh文件 (注意第一行)
#!/bin/bash
cd /home/xueyueshuai/Langchain-Chatchat
source venv1/bin/activate
python startup.py -a