How To Remove Systemd Service
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
How To Remove Systemd Service的更多相关文章
- .NET Worker Service 部署到 Linux 作为 Systemd Service 运行
上一篇文章我们了解了如何将.NET Worker Service 作为 Windows 服务运行,今天我接着介绍一下如何将 Worker Service 部署到 Linux 上,并作为 Systemd ...
- systemd service
Man page systemd.unit SYSTEMD.UNIT(5) systemd.unit SYSTEMD.UNIT(5) NAME systemd.unit - Unit configur ...
- systemd.service 中文手册
版权声明 本文译者是一位开源理念的坚定支持者,所以本文虽然不是软件,但是遵照开源的精神发布. 无担保:本文译者不保证译文内容准确无误,亦不承担任何由于使用此文档所导致的损失. 自由使用:任何人都可以自 ...
- CENTOS/RHEL 7 系统中设置SYSTEMD SERVICE的ULIMIT资源限制
遇到的问题: golang程序一直出现 too many open files的报错, 尽管对 /etc/security/limits.conf 做了设置, 对最大文件打开数,最大进程数做了调优. ...
- 【转】CENTOS/RHEL 7 系统中设置SYSTEMD SERVICE的ULIMIT资源限制
在bash中,有个ulimit命令,提供了对shell及该shell启动的进程的可用资源控制.主要包括打开文件描述符数量.用户的最大进程数量.coredump文件的大小等. 在centos 5/6 等 ...
- Linux Simple Systemd Service Guide
Simple Systemd Service Guide 主题 Systemd介绍 Systemd基本操作 怎样编写_service_.service文件 怎样部署service Systemd介绍 ...
- systemd service 设置limit,不生效问题
参考博文: http://smilejay.com/2016/06/centos-7-systemd-conf-limits/(解决方法参考此博文) 问题简述:Centos7下修改系统的最大文件打 ...
- 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. ...
- 如何编写一个Systemd Service(转)
转自 https://segmentfault.com/a/1190000014740871 0x01 什么是Systemd Service Systemd 服务是一种以 .service 结尾的单元 ...
随机推荐
- JavaWebServle执行流程解析
Servlet Servlet 1.定义: 注:servlet版本2.5 Servlet是Java的一个类.既然是一个类.那必然要遵循一定的规范.如下所示. a.必须继承 javax.servlet. ...
- Mybatis-Plus中使用max、sum聚合函数、只查询指定字段、查询语句多个OR处理
聚合函数查询 可以使用以下方法 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.select(" I ...
- 【九度OJ】题目1435:迷瘴 解题报告
[九度OJ]题目1435:迷瘴 解题报告 标签(空格分隔): 九度OJ http://ac.jobdu.com/problem.php?pid=1435 题目描述: 通过悬崖的yifenfei,又面临 ...
- 第七个知识点:随机性如何辅助计算和什么是BPP类问题
第七个知识点:随机性如何辅助计算和什么是BPP类问题 原文地址:http://bristolcrypto.blogspot.com/2014/11/52-things-number-7-how-doe ...
- 第三十个知识点:大致简述密钥协商中的BR安全定义。
第三十个知识点:大致简述密钥协商中的BR安全定义. 在两方之间建密钥共享是一件密码学中古老的问题.就算只考虑定义也比标准加密困难的多.尽管古典的Diffie-Hellman协议在1976年思路解决了这 ...
- matplotlib 进阶之Artist tutorial(如何操作Atrist和定制)
目录 基本 plt.figure() fig.add_axes() ax.lines set_xlabel 一个完整的例子 定制你的对象 obj.set(alpha=0.5, zorder=2), o ...
- Deepin20系统安装Nvidia驱动
Deepin20系统安装Nvidia驱动 系统设备配置信息如下: 电脑型号:华硕天选air[ASUS-FX516P] 显卡型号:RTX 3070 移动版独显 处理器型号: 11th Gen Intel ...
- 高效位运算 __builtin_系列函数
•int __builtin_ffs (unsigned int x) 返回x的最后一位1的是从后向前第几位,比如7368(1110011001000)返回4. •int __builtin_clz ...
- Java实习生常规技术面试题每日十题Java基础(七)
目录 1. Java设计模式有哪些? 2.GC是什么?为什么要有GC? 3. Java中是如何支持正则表达式. 4.比较一下Java和JavaSciprt. 5.Math.round(11.5) 等于 ...
- Java集合与数组的联系和区别
数组特点 存放一组相同的数据类型(基本类型和对象类型)的数据,从而实现对数据的管理. 优势:可以快速的通过下标对数组元素进行访问,效率高 劣势:容量实现定义好了,不能随着需求变化而扩容. 集合特点 集 ...