There is no general-purpose RC.local file in the Linux release in Debian. If we want to join custom behavior when you start, we can make a rc.local file yourself.
I think the following implementation methods are the simplest and practical use by comparing several kinds of implementations of several and universal rc.local files.
(Reference 1)
1. Create a file in /etc/init.d, can be named, such as rc.local, pay attention to the first line of the file: #! / Bin / sh or #! / Bin / bash.
To implement the above functions in two ways: a. Touch /etc/init.d/rc.local
CD /etc/init.d
Vi rc.local
b. cd /etc/init.d
Vi rc.local
It should be noted that the generated file must be under /etc/init.d.
2. Edit the behavior you want to customize
3. Set the available properties to the new editing file.
CHMOD X rc.local
4. Update the system's startup setting, in other methods, the symbolic connection is manually established in each run level. This method uses a DEBIAN's integration tool Update-rc.d. It is actually a matter, but it is not easy to use integration tools, and it is convenient.
We will use the usage format of Update-Rc.D at this time: update-rc.d scriptname start | stop nn runlevel runlevyl ....
The specific instructions for update-rc.d can view its MAN page.
It is necessary to pay attention to two things:
The first scriptname is a script file name under /etc/init.d/, which is also the reason why the file that emphasizes the generated file in the first step is to be in /etc/init.d. At the same time, this is also
Description When executing the update-rc.d command, the current directory is nothing.
The second must pay attention to the order in the order to be in one sentence ("
") End, otherwise the command is wrong.
For example, we can perform the following command:
Update-rc.d rc.local start 98 2 3 4 5. This command will join the corresponding S98rc.local symbol connection in RC2.D, RC3.D, RC4.D, RC5.D. It will run when the system starts to 2, 3, 4, and 5.
Rc.local script.
In addition, the reason why Rc.local is set to No. 98 is that Debian generates a S99RMnologin symbol connection by default by default. Can't check the instructions on RMNOLOGIN with MAN and HELP. in
I found an article in the debian version of www.linuxsir.org (literature 5), after reading it, I think RMNOLOGIN should be used to delete the NOLOGIN file generated when the system is started. If the NOLOGIN file exists, you can only log in to the system as root, and ordinary users cannot log in. The system defaults Rmnologin in the end, I think it is still not to move it, so rc.local can only be in the past.
references:
1.
Debian rc.local Equivalent
2.
Rc.local-debianwiki
3.
Debian-rc.local
4.
Rc.local in Debian
5.
http://www.linuxsir.org/bbs/showthread.php?t=95352&highlight=Rmlogin