mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-02-04 10:11:28 +08:00
Improve architecture support and systemd config
This commit is contained in:
5
systemd/clash-for-linux.env
Normal file
5
systemd/clash-for-linux.env
Normal file
@ -0,0 +1,5 @@
|
||||
CLASH_HOME=/opt/clash-for-linux
|
||||
# 可选:自定义 PID 文件路径
|
||||
# CLASH_PID_FILE=/opt/clash-for-linux/temp/clash.pid
|
||||
# 可选:自定义 Clash 二进制路径
|
||||
# CLASH_BIN=/opt/clash-for-linux/bin/clash-linux-amd64
|
||||
@ -4,15 +4,16 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/clash-for-linux
|
||||
ExecStart=/bin/bash /opt/clash-for-linux/start.sh
|
||||
ExecStop=/bin/bash /opt/clash-for-linux/shutdown.sh
|
||||
EnvironmentFile=-/etc/default/clash-for-linux
|
||||
Environment=CLASH_HOME=/opt/clash-for-linux
|
||||
ExecStart=/bin/bash -c 'exec /bin/bash "${CLASH_HOME}/start.sh"'
|
||||
ExecStop=/bin/bash -c 'exec /bin/bash "${CLASH_HOME}/shutdown.sh"'
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
User=clash
|
||||
Group=clash
|
||||
PIDFile=/opt/clash-for-linux/temp/clash.pid
|
||||
Environment=CLASH_ENV_FILE=/opt/clash-for-linux/temp/clash-for-linux.sh
|
||||
PIDFile=%E{CLASH_HOME}/temp/clash.pid
|
||||
Environment=CLASH_ENV_FILE=%E{CLASH_HOME}/temp/clash-for-linux.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user