The/etc/rc. local Solution for centos7 will not be executed at startup
Recently, it was found that centos7's/etc/rc. local won't be started, so I carefully read the/etc/rc. local file and found the cause of the problem #! /Bin/bash # this file is added for compatibility purposes # It is highly advisable to create own using EMD services or udev rules # to run scripts during boot instead of using this file. # In constrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # Please note that you must run 'chmod + x/etc/rc. d/rc. local' to ensure # that this script Will be executed during boot. Translation: # This file is added for compatibility issues. # We strongly recommend that you create your own systemd service or udev rules to run scripts at startup instead of using this file. # This script will not be executed after all other services compared with the parallel execution during previous version boot. # Remember, you must execute "chmod + x/etc/rc. d/rc. local" to ensure that this script is executed during boot. So I confirmed the permission for/etc/rc. local [root @ localhost ~] # Ll/etc/rc. locallrwxrwxrwx. 1 root 13 August 12 06:09/etc/rc. local-> rc. d/rc. local [root @ localhost ~] # Ll/etc/rc. d/rc. local-rw-r --. 1 root 477 June 10 13:35/etc/rc. d/rc. local/etc/rc. d/rc. local has no execution permission, so chmod + x/etc/rc is executed according to the description. d/rc. /etc/rc is found after local restart. local can be executed. It looks like the version changes./etc/rc. local/etc/rc. d/rc. local is on the road of discarding.