SystemdClash
SystemdClash copied to clipboard
关于用户等级配置的一点小建议
移除
https://github.com/Sitoi/SystemdClash/blob/191063c94a5526b8497d360b6df7076e7624447b/clash%40.service#L7
并将 [email protected]
重命名为 clash.service
,放置位置由 /lib/systemd/system/[email protected]
改为 /lib/systemd/user/clash.service
,这样使用时只需对应用户执行 systemctl start --user clash
和 systemctl enable --user clash
即可(也可合并为 systemctl enable --now --user clash
)。
这样会在用户登录的同时启动 clash,并且在用户登出后自动关闭。(如果想要登出时不自动关闭请执行 loginctl enable-linger
以启用 linger)
另外,SELinux 的宽容模式是为了方便系统管理员查看日志编写对应规则的,长时间关闭不利于系统安全
在把 clash 执行文件移到 /usr/local/bin/ 文件夹后,执行 sudo restorecon -rv /usr/local/bin/clash
应该就不会出现权限问题。这样就不需要更改 SELinux 的模式了。
参考 https://serverfault.com/questions/957084/failed-at-step-exec-spawning-permission-denied。