Service Introduction
Linux system services are system tasks that are automatically loaded at Linux startup and automatically stopped when Linux exits. In the Linux boot process, we can see a lot of "starting ... "Prompt for information that indicates that the system service is starting, 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 to support Internet connectivity, and so on. CAMS during the installation process, three system tasks are automatically added to ensure that the CAMS service starts automatically at Linux startup, and the CAMS service stops automatically when Linux shuts down. When these three services are separate:
oracled Oracle Database Service
CAMSD Cams Protocol Processing module Service
TOMCAT4 Tomcat Web Server Service to support CAMS Configuration Management desk, self-service platform, Portal service platform and content billing certification platform;
All service program 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 "oracled", "Camsd" and "Tomcat4" three files under this folder.
Start and stop services
The service command is used to start and stop a services, for example:
Service CAMSD stop Stop CAMSD Services
Service oracled Start oracled Services
Service TOMCAT4 Start TOMCAT4 Services
Cams introduces three service dependencies, that is, CAMSD service and TOMCAT4 service dependency and oracled service, can not start oracled service and CAMSD service before the start of TOMCAT4 service;
The CAMSD service and the TOMCAT4 service must be stopped before the oracled service is stopped.
Add, delete, auto-run and status of services
CAMS will automatically add related services during the installation process, prompting the user to start the service (making the service effective) during the final installation process. It is important to note that after a service is added, it does not mean that the service will run automatically during system startup, only that service commands can be used to start and stop services.
1. Add a service
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 its status is "executable";
(2) Add the service to the list of services using the Chkconfig command:
Chkconfig–add CAMSD (note there are two "-")
After the service is added, the service can be started/stopped using service.
2. Delete a service
If you want to delete a service, change the "add" of the above command to "del":
Chkconfig–del CAMSD (note there are two "-")
3. Set the service to run automatically
Linux runs with 7 RunLevel, using 0-6 to indicate that the console interface is running at level 3, the graphical interface is running at 5, and to enable a service to be shipped automatically at system startup, the row uses Chkconfig to add the service to the corresponding level of self-service list.
Chkconfig–level CAMSD On (note there are two "-")
The above command adds the CAMSD service to the list of self-starting services at level 3, 5, and the following command removes the service camsd from the list of self-starting services at level 3 and 5:
Chkconfig–level CAMSD Off (note there are two "-")
If you need to view the self-starting status information for a service, use the following command:
Chkconfig–list CAMSD (note there are two "-")
CentOS Start and stop service detailed