Linux - 利用systemctl命令管理服务
systemctl命令是系统服务管理器指令,融合了service和chkconfig的功能,可以查看和设置服务。
这里以docker服务为例。
利用systemctl命令管理
显示服务状态:systemctl status docker.service
列出服务层级和依赖关系:systemctl list-dependencies docker.service
启动服务:systemctl start docker.service
关闭服务:systemctl stop docker.service
重启服务:systemctl restart docker.service
设置服务自启动:systemctl enable docker.service
禁止服务自启动:systemctl disable docker.service
查看服务是否自启动:systemctl is-enabled docker.service
列出系统所有服务的启动情况:systemctl list-units --type=service
列出所有自启动服务:systemctl list-unit-files|grep enabled
对应的旧指令(chkconfig、service)
显示服务状态:service docker status
列出服务层级和依赖关系:systemctl list-dependencies docker.service
启动服务:service docker start
关闭服务:service docker stop
重启服务:service docker restart
设置服务自启动:chkconfig --level 3 docker on
禁止服务自启动:chkconfig --level 3 docker off
查看服务是否自启动:chkconfig --list docker
列出系统所有服务的启动情况:chkconfig --list
Linux - 利用systemctl命令管理服务的更多相关文章
- Linux中用systemctl命令管理服务
systemctl start foo.service 启动服务systemctl restart foo.service 重启服务systemctl stop foo.service 停止服务sys ...
- 使用systemctl命令管理服务mysql
启动mysql systemctl start mysqld.service 停止mysql systemctl stop mysqld.service 重启mysql systemctl resta ...
- Linux中systemctl命令详细介绍
Linux Systemctl是一个系统管理守护进程.工具和库的集合,用于取代System V.service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器.通过Syst ...
- linux的systemctl 命令用法 转
目录 预热 管理单个 unit 查看系统上的 unit 管理不同的操作环境(target unit) 检查 unit 之间的依赖性 相关的目录和文件 systemctl daemon-reload 子 ...
- Windows:使用Dos命令管理服务(Services)
Windows 服务器系列: Windows:查看IP地址,IP地址对应的机器名,占用的端口,以及占用该端口的应用程 Windows:使用Dos命令管理服务(Services) Windows:任务调 ...
- Linux的setup命令启动服务名称和功能
Linux的setup命令启动服务名称和功能 1 anacron 可执行crontab既定时间内没执行的工作.2 atd 单一使用的例行性命令.3 apmd 了解系统电池电量(手提式计算机使用).4 ...
- Linux利用nc命令脚本批量检测服务器指定端口是否开放
一.nc命令检测端口的用法 # nc -v -w 10 %IP% -z %PORT% -v 显示指令执行过程. -w <超时秒数> 设置等待连线的时间. -u 表示使用UDP协议 -z 使 ...
- 把Asp.Net Core 2.0部署在Linux上,使用Nginx代理服务器,并且用Systemctl命令以服务的方式监听项目
在Linux上部署.net core 2.0程序: 第一步:配置Nginx代理 在/etc/nginx/sites-available/default 中添加 server { listen ; lo ...
- CentOS7 使用systemctl来管理服务
1.建立service文件 以tomcat为例 , 建立tomcat.service文件 #服务说明 [Unit] #服务描述 Description=Tomcat Service #前置需要启动的服 ...
随机推荐
- (转).net反编译工具JustDecompile
开源的反编译工具 JustDecompile https://www.telerik.com/blogs/justdecompile-engine-becomes-open-source https ...
- tensorflow报错error,tf.concat Expected int32, got list containing Tensors of type '_Message' instead
参考:https://stackoverflow.com/questions/41813665/tensorflow-slim-typeerror-expected-int32-got-list-co ...
- prometheus 表达式
avg_over_time(my_inprogress_requests{job="mhc"}[5m] offset 3m) 返回time=1550664637开始向前偏移3分钟之 ...
- cdnbest架设cdn同一个源用不同的端口访问如何设置
在站点里的应用防火墙-->高级设置里配置 比如test.com要同时用80和88访问
- vi怎么统计查找字符串的个数
vi怎么统计查找字符串的个数 用vi打开一个比较大的文本,用vi查找指定字符串,现在怎么统计该字符串的个数呢?比如我查找ORA字符串,直接输入 /ORA的时候vi会高亮显示.现在怎么统计ORA的个数呢 ...
- 正确理解c和c ++的复杂类型声明
本文作者girlrong是网易广州社区的C语言版版主,这篇文章被选在精华区.很是不错,不敢独享!据说她乐于助人,虚心诚恳,颇受网友欢迎.只可惜现在已退隐江湖了.在最近学习C语言过程中,了解些前辈大牛的 ...
- [leetcode]67. Add Binary 二进制加法
Given two binary strings, return their sum (also a binary string). The input strings are both non-em ...
- Python项目--Scrapy框架(二)
本文主要是利用scrapy框架爬取果壳问答中热门问答, 精彩问答的相关信息 环境 win8, python3.7, pycharm 正文 1. 创建scrapy项目文件 在cmd命令行中任意目录下执行 ...
- centos 7 命令行模式和桌面版之间的切换
CentOS7图形界面与命令行界面切换 在图形界面使用 ctrl+alt+F2切换到dos界面 dos界面 ctrl+alt+F2切换回图形界面 在命令上 输入 init 命令 切换到dos界面 输入 ...
- Python开发——基础
注释 单行注释 # 被注释的内容 多行注释 """ 被注释的内容 """ 解释器路径 #!/usr/bin/env python # 用于L ...