Clash Service Linux Config

config clash.service

file path: /etc/systemd/system

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=Clash service
After=network.target

[Service]
Type=simple
User=edward
ExecStart=/usr/bin/clash -d /home/edward/.config/clash >> /home/edward/.config/clash/clash.log
Restart=on-failure
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target
  • start: systemctl start clash
  • stop: systemctl stop clash
  • enable(start when system start): systemctl enable clash
  • disable: systemctl disable clash
  • status: systemctl status clash