Posts /etc/rc.d/rc.local is not working in CentOS7
Post
Cancel

/etc/rc.d/rc.local is not working in CentOS7

Couple days ago I wrote an article about MongoDB Enable User Login Authentication and in that article, I used rc.local to optimize system environment setting for mongodb at system start up. But later on I found that rc.local is working as expected cause optimization is not configured after reboot. So after some research on Google and very soon I found the reason. Since CentOS7,
rc.local

It actually explains all, let’s check the permission before modification. Permission is only 644, no executable permission is given.
rc.local

In order to make rc.local executable, simply run

1
chmod +x /etc/rc.d/rc.local

rc.local

And that’s it, reboot your server to confirm if rc.local is running as exepected!

REFERENCES:
centos 7 /etc/rc.local 开机不执行的问题
CentOS 7 rc.local not working

This post is licensed under CC BY 4.0 by the author.