Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the basic knowledge of Ubuntu service system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the basic knowledge of Ubuntu service system". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the basic knowledge of Ubuntu service system".

one。 Basic knowledge supplement

Under the Linux system, each Ubuntu service runs under a certain "running level". Let's first take a look at the running level. Under the Linux system, the system has six levels, which are:

Running level S: * running levels in the boot process.

Run level 1: (single-user) single-user mode. It is a single-user mode, just like the security mode under Win9x.

Run level 2, 3, 4, 5: multi-user multi-user environment, if subdivided, is:

(1) it is in multi-user mode, but there is no NFS support.

(2) it is a complete multi-user mode and is a standard run-level.

(3) generally not, it can be used to do something in some special cases.

For example, when the laptop battery runs out, you can switch to this mode to make some settings.

(4) it is X11, which has entered the X Window system.

Run level 0: (halt) shut down the computer

Run level 6: (reboot) restart the computer

Let's take Ubuntu Linux as an example. You can find folders like rcS.d,rc1.d,rc2.d and so on in the / etc/ directory. There should be seven. These folders are used to store "links" to Ubuntu services to run (or not to run) at the appropriate (digital) level. Everyone can go in and have a look. All the documents in it should have an "arrow" in the upper left corner. The specific links to these files are unified, pointing to the files under the folder / etc/init.d/.

The files under these seven rc*.d files have something in common, that is, if the opening child of the linked file under the folder is uppercase, then the corresponding script linked under / etc/init.d will be called and opened, and the process will be executed. Conversely, if it is a lowercase letter, the Ubuntu service will not be run.

In addition, the number immediately after the beginning of the linked file S (start) or K (kill) refers to the order in which the small number runs first.

two。 "Control" of system Ubuntu services

From the above, we should know that in fact, if you want to turn on and off a Ubuntu service, you only need to change the * letters of the run-level link file name from uppercase to lowercase (S-> sdinger K-> k). a. (terminal control mode)

First install a tool:

Sudo apt-get install sysv-rc-conf

Then start:

Code: sudo sysv-rc-conf

(note: after entering, draw "x" to indicate that it is selected and started. )

b. (graphical control mode)

1. Installation of BUM: sudo apt-get install bum, just enter. This is fine.

2. The operation of BUM: there are no shortcuts in the "application" after this software is installed. You can enter sudo bum from the terminal to run it.

3. The use of BUM: let's take a look at its interface first. Every time it runs, it will scan the Ubuntu service items of the system first. This is what the scan looks like. Then, we check: Advanced, switch to "Advanced" mode, and then select "Services" to see the "Ubuntu Services" of our current system.

This software is easy to use, if we want to disable a Ubuntu service, find it in the list, then remove the previous "check" and click "apply". Is it easy enough? This software, in addition to controlling the opening and closing of Ubuntu services, can also control the system's on-off script (Startup and shutdown scripts). The operation method is the same, brothers in need can take a look.

4. Use the command method to control the Ubuntu service.

As we said just now, to disable a service is to change the first letter of the corresponding file under rc*.d to lowercase. So we can do this, for example, I want to disable the "mdadm-raid" service, which manages the Raid (disk array) of the system, and if you don't have an array, you don't need it.

Sudo mv / etc/rcS.d/S04mdadm-raid / etc/rcS.d/s04mdadm-raid

It is estimated that people who like to play "command" will certainly choose to do so, hehe, command controllers ~

5. Common "operations" of system Ubuntu services. In linux systems, if you need to temporarily operate on the running state of a Ubuntu service, you can generally do this:

(1) run Ubuntu service: sudo / etc/init.d/ service name start

(2) stop Ubuntu service: sudo / etc/init.d/ service name stop

(1) restart Ubuntu service: sudo / etc/init.d/ service name restart

For example: sudo / etc/init.d/gdm restart

Thank you for your reading, the above is the content of "what are the basic knowledge of Ubuntu service system". After the study of this article, I believe you have a deeper understanding of what the basic knowledge of Ubuntu service system is, and the specific use needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report