How to delete services under linux

青灯夜游
Release: 2022-03-09 16:26:20
Original
15326 people have browsed it

Methods to delete services: 1. Use the "service service name stop" command to stop the service; 2. Use the "rm -rf..." command to clean up process resources (such as installation files); 3. Use "chkconfig –del service name” command to delete the specified service; 4. Delete the service startup file.

How to delete services under linux

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Delete the service under Linux

1 Stop the service

[root]# service my_service stop
Copy after login

2 Clean up the process Resources (such as installation files)

[root]# cd /usr/sbin
[root]# rm -rf my_service_file
Copy after login

3 Delete services

Note: The purpose is to clean up the soft links of the service startup files. Update startup resources.

Usage syntax:

chkconfig [--add][--del][--list][系统服务] 或 chkconfig [--level <等级代号>][系统服务][on/off/reset]
Copy after login

Parameter usage:

  • -add Add the specified system service so that the chkconfig command can manage it and at the same time Add relevant data to the system startup narrative file.

  • –del Delete the specified system service, which is no longer managed by the chkconfig command, and delete related data in the system startup narrative file.

  • –level Specifies the execution level in which the reading system service should be turned on or off.

Usage example:

chkconfig –list                     列出所有的系统服务;
chkconfig –add httpd                增加httpd服务;
chkconfig –del httpd                删除httpd服务
Copy after login

4 Delete the service startup file

rm -rf /etc/rc.d/init.d/my_service_script
Copy after login

Related recommendations: "Linux Video Tutorial

The above is the detailed content of How to delete services under linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template