Linux boot /etc/rc.local failure problem to provide three ways to solve the boot can not start the rc.local file problem, need friends refer to the following.
/etc/rc.local = /etc/rc.local
1, echo /etc/rc.local>
1, echo /etc/rc.local>; > /etc/profile & & Source /etc/profile
2>eboot
br>
2, reboot
echo /etc/rc.local>
echo /etc/rc.local> > ~/.bash_profile & & The source/etc/profile
Third:
in the/etc/rc3. D increase a startup scripts directory, and then restart the test, the content is as follows:
cat /etc/rc3.d/StartDefautRoute.sh
#! /bin/bash
# [email protected]
route add default gateway 192.168.1.1 dev xenbr0
Some commands cannot be executed in /etc/rc.local
To add a service that automatically runs when the system is started, simply add it to the /etc/rc.local script file. When the command or program is running without a path, for example:
#! /bin/bash
Distccd –user nobody –allow 10.10.98.0/24 –log-file=/var/log/distcc.log –verbose –daemon
loadavg-s 10.10.98.20>; /dev/null 2> & 1
Note that the distccd, loadavg commands are stored in /usr/local/bin/
When the system executes these commands, it will report an error and cannot execute properly!
Because the PATH environment variable was not fully initialized when the rc.local script was executed, the directory /usr/local/bin/ was added to the PATH environment variable only after /etc/profile was executed.
Executing commands in /usr/local/bin/directory in /etc/rc.local requires absolute path.
Read More:
- Centos7 via / etc/ rc.local File configurator boot
- RTR3InitEx failed with rc=-1912 (rc=-1912)
- java.lang.UnsupportedOperationException resolvent
- Mac boot boot the most detailed explanation, so that the automatic start of the program can not escape
- The solution of default boot device missing or boot failed appears on the blue screen of Lenovo xiaoxinchao 7000
- Spring boot problem 1: error reporting life processing instructions for building a spring boot project
- Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:repackage failed
- [Solved] qt5.9 + vs2015 32bit Error: “-1: error: LNK1158: Can not Run “rc.exe”
- VS2013 error RC2108: expected numerical dialog constant
- Callee RC: RegDB_ E_ CLASSNOTREG (0x80040154)
- Win10 desktop right click display settings MS- settings:display Or Ms- settings:personalization-background resolvent
- Spring cloud Alibaba 2020.0.rc1 does not integrate ribbon error reporting unknownhostexception
- Sudo: parse error in / etc / sudoers near line 24
- Error found when loading /etc/profile when ubuntu18.04 is booted
- Vs2015 cannot open the file string. H, etc
- cas report error (No subject,’principal’ cannot be null, PKIX path validation failed, etc.)
- Error c2375: “wsacleanup”: redefine; Different links, etc
- Python failed to use PIL writer library. TTF, etc. oserror: cannot open resource
- HDFS and local file transfer and error reporting
- After the installation of vs2017, we can’t find the source files such as windows. H, stdio. H, etc