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

Modification and View method of CentOS Boot Startup Service

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

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the modification and viewing method of CentOS boot service". In the daily operation, I believe that many people have doubts about the modification and viewing method of CentOS boot service. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "modification and viewing method of CentOS boot service". Next, please follow the editor to study!

Press [CTRL] + [ALT] + [F7] / [F8] to view the services being started when the system is started!

It is well known that Linux provides us with different startup levels of 0startup 6, so different startup levels will start those services. You can use chkconfig-- list to view it, and you can use the chkconfig service name-- level 3 {on | of} to modify whether to start or stop at a certain level.

1. For example, stop the sshd service at the third startup level.

[root@team4 rc3.d] # chkconfig sshd-- level 3 off

two。 You can also modify it manually, and there are many directories corresponding to different runlevel in the / etc/rc.d/ directory, which indicates that those services should be started and stopped when you enter a startup level.

For example:

[root@team4 etc] # ls / etc/rc.d

Init.d rc0.d rc2.d rc4.d rc6.d rc.sysinit

Rc rc1.d rc3.d rc5.d rc.local

Let's take the rc3.d directory as an example, which records the services that need to be stopped and started to enter init 3.

The following is the contents of the rc3.d directory:

[root@team4 etc] # ls / etc/rc.d/rc3.d/

K02avahi-dnsconfd K89pand S25bluetooth

K02dhcdbd K89rdisc S25netfs

K02NetworkManager K91capi S25pcscd

K02NetworkManagerDispatcher K99readahead_later S26apmd

K05conman S04readahead_early S26hidd

K starts with the service that this startup level needs to stop, the number is the order in which it is executed when it is stopped, and then the service is clear.

The start of S is to start those services.

Note: execute the K first, then the S first. So services starting with S will override services starting with K.

Boot self-start of Linux setup Program and Linux Service

Here I only say what I know, as an example

The requirement is that I need to connect to Linux Server using VNC Viewer under Windows. I'll type under Linux

# vncserver

Set the password, so now I can use VNC to connect to the Linux desktop under Windows. At this time, if my Linux Server system restarts, I have to type the vncserver command again, so now I want Linux Server to start vncserver automatically when it starts.

What are the methods?

1. I can set up vncserver as a system service and start it, and use the following command to see if vncserver is already a system service.

# chkconfig-- list | grep vnc

Vncserver 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Now we are going to set vncserver to boot automatically, using the following command

# chkconfig-level 5 vncserver on#chkconfig-list | grep vnc

Vncserver 0:off 1:off 2:off 3:off 4:off 5:on 6:off

If you restart the system at this time, vncserver will automatically start as a service, but now if you want to use vnc immediately, you can simply type the command vncserver.

two。 We can write the vncserver command in the scripts to be run when Linux is booted. Which scripts should be executed when Linux boots?

What I know is as follows:

/ etc/rc.local

/ etc/rc.sysinit

/ etc/inittab

/ etc/profile

Keep in mind here the differences and connections between Linux services and Linux boot self-booting.

At this point, the study on "the modification and viewing method of CentOS boot service" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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