Linux Service Startup speed-up Manual (1)

Source: Internet
Author: User

Linux is a very good operating system, but a long start time is one of the shortcomings of this system. Can I use some settings to shorten the Linux Startup time? Of course. This article will show you how to shorten the startup time without sacrificing the availability of the Linux system. To achieve this goal, you need to understand the various services of the system and their subordination, so that they can be started at the same time as allowed, thus greatly saving the system startup time.

Preparations

If you want to use the method described in this article to set the Linux system, you must first be familiar with the setting language of the Linux system. Setting the system startup process is a dangerous action, which may cause the system to fail to start. Once this happens, you 'd better restart the system and select single user mode to restore and restart the system. Of course, the most important thing is to back up important data before setting.

Next, we recommend that you test the modification before modifying the local system. If you only have one computer, we recommend that you use the user mode Linux system UML) for testing. UML is a kernel patch that translates the Linux kernel into binary so that users can run the Linux system as they do with common software. In the event of an accident, only UML is lost, while the original system is safe and sound.

Linux Startup sequence and runlevel

Linux system startup involves multiple steps. Here we will introduce the system startup steps after the kernel is loaded. You can run the/sbin/runlevel command to view the current runlevel of the system. Runlevel is a number used in Linux to distinguish between advanced startup settings. These numbers are very common, and most of them have clear meanings. Taking Red Hat Linux as an example, its runlevel mainly includes the following types:

1) anacron can execute jobs not executed within the specified time range of crontab.

2) Routine commands used by atd.

3) apmd understands the battery usage of portable computers ).

4) arpwatch continuously monitors the MAC and IP addresses of network cards.

5) autofs automatically mounts some devices.

6) cups printing service.

7) chargentcp) when the customer sends a data report, the TCP server sends a continuous rst stream until the customer breaks the link.

8) the chargen-udp UDP server sends a random length datagram.

9) crond executes routine commands in/etc/crontab.

10) daytime date and time server.

11) daytime-udp Date and Time Server.

12) dhcpd Dynamic Host protocol allocation server.

13) echo server.

14) echo-udp echo server.

15) use the mouse in the gpm text mode to move, copy, paste, and other functions.

16) httpd www server.

17) identd daemon server.

18) finger allows remote users to view local user information.

19) iptables routing rules firewall, NAT, etc ).

20) the new device is detected when kudzu is started.

21) mysql database server.

22) named DNS server.

23) network functions.

24) keytable: Set the letter format on the keyboard.

25) postgresql database server.

26) random server to improve system security.

27) rarpd Reverse Address Resolution Service.

28) smb is compatible with windows.

29) sshd ssh remote control.

30) syslog System Record service.

31) telnet remote control.

32) tftp simple file transfer service.

33) xfs graphic interface service.

34) xinetd daemon ......

How does init initialize the system?

Init can use an ASC Ⅱ setup file to learn how to change the runlevel of the system. In general, this setting file can guide init to execute the/etc/rc. d/rc command to obtain runlevel information.

System Service

The various system services required by the user are started by the rc command program. The potential services of the system are complicated. Most Linux systems generally only provide sshd (SecureShell Service), syslog (System Log tool), and lpd (Print Service) functions.

You can find all services in the/etc/rc. d/directory. If you open this directory, you will find that many services are just a shell program, which only directs other programs to complete the work. Some may ask, how does the rc program know which programs should be run at each runlevel? The answer is that under the/etc/rc. d/directory, there are some directories that correspond to their own runlevel. Their names are rc *. d/. For example, runlevel 5 is/etc/rc. d/rc5.d /. Each rc *. d/directory contains two symbolic links that can be connected to a specified service program in the/etc/init. d/directory.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.