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 结尾的单元 ...
随机推荐
- 使用vi编辑时,上下左右键显示为字符的问题
1.此问题是因为ubuntu系统自带的 vi 不完整导致,解决方法:安装完整的vi,执行命令: # sudo apt-get install vim-gtk
- React Color使用
需求 - 要在react项目中实现颜色获取器功能 解决方案 - 使用react-color 依赖 - git地址:https://github.com/casesandberg/react-color ...
- 谷歌浏览器(chrome)查找、打包已安装的扩展程序
我们有时候会安装浏览器扩展程序,正常情况下,我们回去谷歌应用商店里面进行下载,但是这个需要VPN,有时候我们没法使用VPN,想从其他已安装扩展程序的浏览器上直接安装就可以使用我们下面这个方法 win1 ...
- 在制造业的工业2.0中应用MOM系统
介绍 什么是制造运营管理 (MOM) 系统和 IT 架构的最佳实践? 行业专家对制造类型和供应网络有何建议? 管理思维和企业文化是否因不断变化的全球市场而过时? MOM 技术是否过于昂贵,IT 架构是 ...
- 关于编写c++动态库常用的定义
1. 关于 1.1 最近一段时间,写了不少动态库,慢慢的也积累了东西. 1.2 之前一直做Windows的动态库,没有做过Linux和OS X的动态库,太缺乏经验了: 代码缺乏 编译器支持的判断.缺乏 ...
- 【LeetCode】230. 二叉搜索树中第K小的元素 Kth Smallest Element in a BST
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 公众号:负雪明烛 本文关键词:算法题,刷题,Leetcode, 力扣,二叉搜索树,BST ...
- 【LeetCode】504. Base 7 解题报告(Java & Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 内建库 BigInteger类 逐位计算 倍数相加 ...
- 【LeetCode】795. Number of Subarrays with Bounded Maximum 解题报告(Python & C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 动态规划 暴力搜索+剪枝 线性遍历 日期 题目地址: ...
- 【LeetCode】306. Additive Number 解题报告(Python)
[LeetCode]306. Additive Number 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http: ...
- Java并发:五种线程安全类型、线程安全的实现、枚举类型
1. Java中的线程安全 Java线程安全:狭义地认为是多线程之间共享数据的访问. Java语言中各种操作共享的数据有5种类型:不可变.绝对线程安全.相对线程安全.线程兼容.线程独立 ① 不可变 不 ...