Home > Operation and Maintenance > Linux Operation and Maintenance > What are the methods for booting Linux?

What are the methods for booting Linux?

little bottle
Release: 2020-09-10 14:45:20
Original
24018 people have browsed it

Today, the editor will teach you two simple and easy-to-understand methods for booting Linux, which is to set up the auto-start program at boot. The first method is to edit "/etc/rc.local" and enter the shell command to start the program; the second method is to register it as a system service. Interested friends can study with the editor, I hope it will be helpful to you.

What are the methods for booting Linux?

How to start Linux on boot:

1./etc/rc.local

The rc.local is executed after all system initialization is completed, so we can write the startup script into it.
This is the simplest method. Edit "/etc/rc.local" and enter the shell command to start the program (the full path of the command must be entered).

rc.local starts with the root account by default. The method to start using other accounts is:

su - admin -c '/bin/sh /usr/local/rsync/rsync.sh'

2. Registration System services
The services that come with the operating system, such as ssh, ftp, etc., are automatically started at boot.

But if I want to add an installed service as a system service, I can execute the following command:

Put the startup script in the directory /etc/rc.d/init.d Next

chkconfig --add service name                                                                                                                                                                                       .

(Explanation, level 3 means starting in command line mode, level 5 means starting in graphical interface, on means turning on)


chkconfig -leve startup level service name off            

(Explanation, off means to turn off auto-start)


For example: chkconfig -level 3 mysql on                                                                                                                                                                                                     # You can also use chkconfig --del service name to delete system services

If you want to see which services have been added as system services, you can use the command:

chkconfig --list/chkconfig

If you want to check which programs have been added as self-starting, you can use the command:

cat /etc/rc.local (check which program paths have been added to this file)

Related tutorials:

Linux video tutorial

The above is the detailed content of What are the methods for booting Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template