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

How CentOS starts and stops services

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

Share

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

This article will explain in detail how to start and stop the service of CentOS. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Service introduction

Linux system service is a system task that loads automatically when Linux starts and stops automatically when Linux exits. During the startup of Linux, we can see a lot of "starting …" messages indicating that the system service is being started, and when Linux exits, we can also see the corresponding "Stopping …" message, indicating that the system service is stopping. Linux itself has many system tasks, such as the "network" service used to support network connections. During the installation process, CAMS automatically adds three system tasks to ensure that the CAMS service starts automatically when Linux starts and stops automatically when Linux shuts down. When these three services are:

Oracled Oracle database service

Camsd CAMS protocol processing module service

Tomcat4 Tomcat Web Server service, which is used to support CAMS configuration management desk, self-service platform, Portal service platform and content billing authentication platform, etc.

All server scripts for the Linux system can be found in the "/ etc/rc.d/init.d" folder, and each service corresponds to a script file. If CAMS is already installed, we can find the three files "oracled", "camsd" and "tomcat4" in this folder.

Start and stop services

The service command is used to start and stop a service, such as:

Service camsd stop stops the camsd service

Service oracled start starts the oracled service

Service tomcat4 start starts the tomcat4 service

There are dependencies among the three services introduced by CAMS, that is, camsd services and tomcat4 services depend on oracled services. Camsd services and tomcat4 services cannot be started before oracled services are started.

The oracled service and tomcat4 service must be stopped before the camsd service is stopped.

Add, delete, autorun and status of services

CAMS automatically adds related services during installation and prompts the user whether to start the service (to make it effective) at the end of the installation. It should be noted that after a service is added, it does not mean that the service will run automatically during system startup, but that the service can be started and stopped using the service command.

1. Add Servic

The steps to add a service are:

(1) copy the script file of the service into the "/ etc/rc.d/init.d" folder to ensure that its status is "executable"

(2) use the chkconfig command to add services to the list of services:

Chkconfig-add camsd (notice there are two "-")

Once the service is added, the service can be started / stopped using service.

two。 Delete a service

If you want to delete a service, change the "add" of the above command to "del":

Chkconfig-del camsd (notice there are two "-")

3. Set the service to run automatically

There are seven running levels of Linux, which are represented by 0-6 respectively. The console interface is running at level 3 and the graphical interface is running at level 5. To make a service run automatically when the system starts, use chkconfig to add the service to the list of self-starting services at the corresponding level.

Chkconfig-level 35 camsd on (notice there are two "-")

The above command adds the camsd service to the list of self-starting services at levels 3 and 5, while the following command removes the service camsd from the list of self-starting services at levels 3 and 5:

Chkconfig-level 35 camsd off (notice there are two "-")

If you need to view the self-startup status information of a service, use the following command:

Chkconfig-list camsd (notice there are two "-")

This is the end of the article on "how to start and stop CentOS service". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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