Method

systemctl stop [servicename]
systemctl disable [servicename]
rm /your/service/locations/[servicename]
rm /your/service/locations/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed

Systemd uses unit (file to define services) to remove a service the unit have to be removed... here is a list of unit locations :[1]

/etc/systemd/system/ (and sub directories)
/usr/local/etc/systemd/system/ (and sub directories)
~/.config/systemd/user/ (and sub directories)
/usr/lib/systemd/ (and sub directories)
/usr/local/lib/systemd/ (and sub directories)
/etc/init.d/ (Converted old service system)

You can easily find location in loaded property using systemctl status [service]

$ systemctl status bluetooth.service
bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:bluetoothd(8)

Or using systemctl cat [service]

# systemctl cat frps.service
# /lib/systemd/system/frps.service
[Unit]
Description=Frp Server Service
After=network.target [Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frps -c /etc/frp/frps.ini [Install]
WantedBy=multi-user.target

About "reset-failed" Option

From the systemd man page:

reset-failed [PATTERN...]

Reset the "failed" state of the specified units, or if no unit name is passed, reset the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code, terminating abnormally or timing out), it will automatically enter the "failed" state and its exit code and status is recorded for introspection by the administrator until the service is restarted or reset with this command.

Reference


  1. How to remove systemd services

How To Remove Systemd Service的更多相关文章

  1. .NET Worker Service 部署到 Linux 作为 Systemd Service 运行

    上一篇文章我们了解了如何将.NET Worker Service 作为 Windows 服务运行,今天我接着介绍一下如何将 Worker Service 部署到 Linux 上,并作为 Systemd ...

  2. systemd service

    Man page systemd.unit SYSTEMD.UNIT(5) systemd.unit SYSTEMD.UNIT(5) NAME systemd.unit - Unit configur ...

  3. systemd.service 中文手册

    版权声明 本文译者是一位开源理念的坚定支持者,所以本文虽然不是软件,但是遵照开源的精神发布. 无担保:本文译者不保证译文内容准确无误,亦不承担任何由于使用此文档所导致的损失. 自由使用:任何人都可以自 ...

  4. CENTOS/RHEL 7 系统中设置SYSTEMD SERVICE的ULIMIT资源限制

    遇到的问题: golang程序一直出现 too many open files的报错, 尽管对 /etc/security/limits.conf 做了设置, 对最大文件打开数,最大进程数做了调优. ...

  5. 【转】CENTOS/RHEL 7 系统中设置SYSTEMD SERVICE的ULIMIT资源限制

    在bash中,有个ulimit命令,提供了对shell及该shell启动的进程的可用资源控制.主要包括打开文件描述符数量.用户的最大进程数量.coredump文件的大小等. 在centos 5/6 等 ...

  6. Linux Simple Systemd Service Guide

    Simple Systemd Service Guide 主题 Systemd介绍 Systemd基本操作 怎样编写_service_.service文件 怎样部署service Systemd介绍 ...

  7. systemd service 设置limit,不生效问题

    参考博文: http://smilejay.com/2016/06/centos-7-systemd-conf-limits/(解决方法参考此博文)   问题简述:Centos7下修改系统的最大文件打 ...

  8. How to Remove A Service Entry From Win10 Service List

    Warning Please do this operation CAREFULLY, otherwise you may get something wrong with your system. ...

  9. 如何编写一个Systemd Service(转)

    转自 https://segmentfault.com/a/1190000014740871 0x01 什么是Systemd Service Systemd 服务是一种以 .service 结尾的单元 ...

随机推荐

  1. Vue页面内公共的多类型附件图片上传区域并适用折叠面板

    在前端项目中,附件上传是很常用的功能,几乎所有的app相关项目中都会使用到,一般在选择使用某个前端UI框架时,可以查找其内封装好的图片上传组件,但某些情况下可能并不适用于自身的项目需求,本文中实现的附 ...

  2. Linux(Centos)安装中文字体库(文档中文字符不显示)

    yum -y install fontconfig 在/usr/shared/fonts目录下新建一个目录chinese 然后打开windows本地的字体库 将这里面的所有文件上传到centos里我们 ...

  3. JAVA获取本机的MAC地址

    /** * 获取本机的Mac地址 * @return */ public String getMac() { InetAddress ia; byte[] mac = null; try { // 获 ...

  4. SpringCloud(三) Zuul

    Zuul 有了eureka . feign 和 hystrix 后,基本上就搭建了简易版的分布式项目,但仍存在一些问题,比如: 1.如果我们的微服务中有很多个独立服务都要对外提供服务,那么我们要如何去 ...

  5. nim_duilib之msgbox用法(23)

    概述 本文将介绍 msgbox 的用法 更多用法,请参考 源码 改进了原有的xml样式 一个样式 xml结构 整体垂直布局 xml源码 demo源码下的msg/msg.xml文件内容 改为如下 注意: ...

  6. c++设计模式概述之命令

    代码写的不够规范,目的是为了缩短文章篇幅,实际中请不要这样做.  1.概述 命令模式是一种数据驱动的模式.将请求封装到命令的对象中,再传给调用对象,调用对象再处理该命令. [将一个请求封装为一个对象] ...

  7. 【LeetCode】557. Reverse Words in a String III 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Java解法 Python解法 日期 题目地址:ht ...

  8. 【剑指Offer】04. 二维数组中的查找 解题报告(Java & Python & C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 解题方法 日期 题目地址:https://leetcode-cn.com/ ...

  9. Solon 1.6.11 发布。类似 Spring 的生态体系

    关于官网 千呼万唤始出来: https://solon.noear.org .整了一个月多了,总体样子有了...还得不断接着整! 关于 Solon Solon 是一个轻量级应用开发框架.支持 Web. ...

  10. 编写Java程序,以树形结构显示国家-直辖市/省/州信息

    返回本章节 返回作业目录 需求说明: 以树形结构显示国家-直辖市/省/州信息 实现思路: 创建显示树形结构的类Tree,在该类中定义Map类型的全局实例属性countryMap,该Map集合用于存放所 ...