centos7 配置了shadowsocks,想简单地配置开机启动,于是在 /etc/rc.local中添加启动的命令如图:
直接运行 /etc/rc.local
是可以启动的,而且也给了rc.local执行权限 chmod +x /etc/rc.local
但是为什么reboot的时候不会运行呢,reboot完后我systemctl status rc-local
,得到的是:
shadowsocks启动不了。但是当我systemctl restart rc-local
的时候:
此时就正常启动了。那这还有什么开机启动的意义,请问是为何?
It turns out that it is not a problem with rc.local, but a problem with ss configuration. I logged the ss log and found it. .
Because of the soft link of
/etc/rc.local
是文件/etc/rc.d/rc.local
, you need to give the latter executable permission, and then restart it to start it: