码迷,mamicode.com
首页 > 其他好文 > 详细

利用 systemd 实现 Clash 开机自启

时间:2020-01-21 20:08:56      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:enable   desc   unit   after   rev   信息   开机启动   cst   emctl   

利用 systemd 实现 Clash 开机自启

首先准备 Clash 的服务脚本,并保存为/etc/systemd/system/clash.service。内容如下:

[Unit]
Description=Clash service
After=network.target

[Service]
Type=simple
User=skylee
ExecStart=/usr/bin/clash
Restart=on-failure
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target

其中User=后面接的内容是你自己的用户名。

设置 Clash 的开机启动项,检查状态,服务启动成功之后,根据信息设置自己客户端的代理协议类型及端口:

sudo systemctl daemon-reload
sudo systemctl enable clash
sudo systemctl start clash
sudo systemctl status clash

利用 systemd 实现 Clash 开机自启

标签:enable   desc   unit   after   rev   信息   开机启动   cst   emctl   

原文地址:https://www.cnblogs.com/skylee03/p/12222767.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!