新建一个服务名:
sudo vim /etc/systemd/system/xxx.service
然后填入:
1 2 3 4 5 6 7 8 9 10 11 12 |
[Unit] Description=mcj After=network.target Wants=network.target [Service] Restart=on-failure RestartSec=5 ExecStart=具体命令 [Install] WantedBy=multi-user.target |
重新加载服务并启动,命令如下:
#刷新服务列表:
systemctl daemon-reload
#设置开机自启
systemctl enable xxx
#关闭开机自启
systemctl disable xxx
#启动服务
systemctl start xxx
#停止服务
systemctl stop xxx
#服务状态
systemctl status xxx
学习
学习
太需要了!謝謝!!
啊
哈哈哈
不知为何 执行 systemctl enable qbittorrent 以使 qBittorrent 开机启动,执行 systemctl start qbittorrent 以使 qBittorre
终端怎么换啊
啊啊为什么啊,我开个终端它一直加载,纯纯哭泣了