Fixed issue: The boot entry for /etc/rc.local file configuration does not work
Start by looking at the contents of the /etc/rc.local file to find the cause of the problem.
[root@localhost ~]# cat /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#**这This file was added for compatibility**
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#** It is highly advisable to create your own systemd services or udev rules to run scripts during boot instead of using this file. ***
# In contrast to previous versions due to parallel execution during boot
# This script will NOT be run after all other services.
#** In contrast 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 'parallel execution during boot'.
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
#** Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot.
touch /var/lock/subsys/local
#**Create the file /var/lock/subsys/local**
According to the prompt, it may not execute because the file permissions are insufficient. So, first look at the permissions for the /etc/rc.local file.
[root@localhost ~]# ll /etc/rc.local
-rw-r--r--. 1 root root 13 Apr 21 23:06 /etc/rc.local -> rc.d/rc.local
/etc/rc.d/rc.local = /etc/rc.local = /etc/rc.local = /etc/rc.local = /etc/rc.local = /etc/rc.local = /etc/rc.local = /etc/rc.local = /etc/rc.local
[root@localhost ~]# chmod +x /etc/rc.d/rc.local
[root@localhost ~]# ll /etc/rc.d/rc.local
-rwxr-xr-x. 1 root root 13 Apr 21 23:06 /etc/rc.d/rc.local
After restarting the server, I found that the boot items set in the /etc/rc.local file are working properly.
Read More:
- U-boot NFS download file error: loading: * * * error: File lookup fail solution
- [Solved] /usr/local/libexec/mecab/mecab-dict-index: error while loading shared libraries: libmecab.so.2: cannot open shared object file: No such file or directory
- [Solved] keystone Install Error: Failed to parse /etc/keystone/keystone.conf: at /etc/keystone/keystone.conf:687
- Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists
- [Solved] Yum Install Software Error: Invalid configuration value: failovermethod=priority…
- [Ubuntu] How to Solve dpkg Error: dpkg: error: failed to open package info file ‘/usr/local/var/lib/dpkg/status’ for reading: No such file or directory
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- Fastplanner compilation error: Could not find a package configuration file provided by “cmake_modules”
- [Solved] Ubuntu Server 18.4 System /etc/sudoers: syntax error near line 32
- [Solved] source /etc/profile Error: not a valid identifier
- summary of configuration and deployment of uwsgi+nginx+flag in centos7 and why internal server error is prompted [official instructions]
- Petalinux-boot –jtag error [How to Solve]
- AFTER THE GIT SOURCE CODE IS INSTALLED, AN ERROR IS REPORTED /USR/BIN/GIT: NO SUCH FILE OR DIRECTORY
- Weblogic Deployment Error: The most likely cause is an error in the network configuration of this machine.
- hive: How to Process Data (Delete, View, Query, and etc)
- [Solved] bash: /etc/vimrc: line 15: syntax error near unexpected token `“autocmd“‘
- Solution to gzip: stdin: invalid compressed data — format violated error in decompressing. Tgz file under Linux
- Chinese garbled problem when running. C file in Linux
- Linux Mint: linuxbrew Install and Boot Error [How to Solve]
- [Solved] ubuntu Run jupyter Error: print(‘Error in generated code:‘, file=sys.stderr) SyntaxError: invalid syntax