为用户帐户运行 mihomo-linux-arm64 系统实例
重新加载 systemd
模块
systemctl daemon-reload
启动 clash
服务
systemctl start clash.service
设置开机自启
在开机时启用一个服务:
systemctl enable clash.service
在开机时禁用一个服务:
systemctl disableclash.service
编写 systemd 服务脚本
常规:
[Unit]
Description=Clash Service
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/app/Clash/mihomo-linux-arm64 -f /usr/local/app/Clash/conf/config.yaml
Restart=on-failure
[Install]
WantedBy=multi-user.target
可变路径:
[Unit]
Description=A rule based proxy in Go for %i.
After=network.target
[Service]
Type=simple
User=%i
Restart=on-abort
ExecStart=/usr/local/app/Clash/mihomo-linux-arm64 -f /usr/local/app/Clash/conf/config.yaml
Restart=on-failure
[Install]
WantedBy=multi-user.target
docker镜像
拉取:
docker pull metacubex/mihomo
docker run -d --restart=always --name mihomo --net=host metacubex/mihomo