linux - rc.local 自启动脚本的问题
PHP中文网
PHP中文网 2017-04-17 16:35:06
0
2
740

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的时候:

此时就正常启动了。那这还有什么开机启动的意义,请问是为何?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
伊谢尔伦

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:

chmod 755 /etc/rc.d/rc.local
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!