不知从什么时候开始,发现开机后ss总没有成功启动,每次开机后总要restart一下ss-libev的service才能上谷歌。
今天解决一下:
查看一下unit
cat /usr/lib/systemd/system/[email protected]
```ini
[Unit]
Description=***-Libev Client Service
After=network-online.target[Service]
[Install]
Type=simple
User=nobody
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
ExecStart=/usr/bin/ss-local -c /etc/shadowsocks/%i.json
WantedBy=multi-user.target
```- 打印以下启动顺序
systemd-analyze plot > aaa.svg
可以发现ss的服务紧跟着network-online.target
就启动了,而无线网卡的启动则在它之后。 - 修改一下unit
保险起见,把它改到 multi-user.target 之后,并把Type改成了idle.
Before/After需要和required配合使用,如下:
systemctl daemon-reload
http://www.jinbuguo.com/systemd/systemd-analyze.html
https://www.mauras.ch/systemd-run-it-last.html
https://unix.stackexchange.com/questions/379363/how-can-i-start-systemd-service-units-in-orde
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。