systemctl使用
systemctl start httpd.service
这会启动httpd服务,就我们而言,Apache HTTP服务器。
要停掉它,需要以root身份使用该命令:
systemctl stop httpd.service
要重启,你可以使用restart选项,如果服务在运行中,它将重启服务;如果服务不在运行中,它将会启动。你也可以使用try-start选项,它只会在服务已经在运行中的时候重启服务。同时,reload选项你也可以有,它会重新加载配置文件。
systemctl restart httpd.service
systemctl try-restart httpd.service
systemctl reload httpd.service
我们例子中的命令看起来会像下面这样:
检查服务状态
要检查服务状态,你可以使用status选项,看这里:
systemctl status httpd.service
输出结果就像这样:
它会告诉你运行中的服务的方方面面。
使用启用/禁用服务来控制开机启动
你也可以使用enable/disable选项来控制一个服务是否开机启动,命令如下:
systemctl enable httpd.service
systemctl disable httpd.service
输出结果看这里:
虽然在过去的几年中,对systemd的采用饱受争议,然而大多数主流发行版都已经逐渐采用或打算在下一个发行版中采用它。所以,它是一个有用的工具,我们需要好好熟悉它
systemctl使用的更多相关文章
- Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details
thinkphp 在Apache上配置启用伪静态,重启Apache1 restart 竟然失败了,报错 Job for httpd.service failed because the control ...
- Centos7中systemctl命令详解
Linux Systemctl是一个系统管理守护进程.工具和库的集合,用于取代System V.service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器.通过Syst ...
- 【搬运】systemctl 命令完全指南
Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器. Systemd是一个系统管理守护进程.工具和库的集合,用于取代System V初始进程.Systemd的功能是 ...
- CentOS 7 启动、重启、chkconfig等命令已经合并为systemctl
CentOS 7系统服务启动.重启.设置服务启动项命令以合并为,systemctl . 现在用service 或/etc/init.d/命令,重启,重新启动,停止等没效果,因为命令合并为systemc ...
- Ubuntu 和 Redhat / Fedora 服务管理命令对比表(附Fedora16新的服务管理工具systemctl )
以 apache/httpd 服务作为例子 任务 Red Hat / Fedora Ubuntu Ubuntu (with sysv-rc-conf or sysvconfig) 立即启动/停止某服务 ...
- systemctl命令用法详解
systemctl命令用法详解系统环境:Fedora 16binpath:/bin/systemctlpackage:systemd-units systemctl enable httpd.serv ...
- systemctl 取代 service
要使用systemd, linux内核版本要高于: 2.6.39 systemctl的命令格式: systemctl 动作命令(如start stop restart status) 服务名称.ser ...
- centos systemctl指令
# systemctl #输出已激活单元 # systemctl list-units #输出已激活单元 # systemctl --failed #输出运行失败的单元 # systemctl lis ...
- centos7 systemctl 启动 Redis 失败
转自:http://sloger.info/posts/systemd-failed-to-start-redis-in-gentoo 今天启动 Redis 时阻塞很长时间,之后显示启动失败,启动状态 ...
- centos7 systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 实例: 启动nfs服务:systemctl start nfs-server.s ...
随机推荐
- AtCoder Regular Contest 81
链接 C.Make a Rectangle 给出一堆木棍的长度 从中选4根,询问在能围成矩形的情况下,矩形的最大面积 开个map统计一下就行 分正方形和矩形分别统计即可 复杂度$O(n \log n) ...
- codevs 3160 最长公共子串 后缀自动机
http://codevs.cn/problem/3160/ 后缀自动机板子题,匹配的时候要注意如果到一个点失配向前匹配到一个点时,此时的tmp(当前匹配值)为t[j].len+1而不是t[t[j]. ...
- Nginx服务器的启动控制
写在前面的话:读书破万卷,编码如有神--------------------------------------------------------------------主要内容包括: nginx服 ...
- [转]android中OnTouch和OnClick、 imagebutton的src和background有什么区别
1.OnTouch和OnClick有何区别? 专业回答 1.onClick就传入一个View对象,而 onTouch要传入一个View 对象和 MotionEvent的对象2.onTouch对控件 ...
- BZOJ 2976: [Poi2002]出圈游戏 HDU 5668 CRT
2976: [Poi2002]出圈游戏 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=2976 Description Input 中第一 ...
- CDOJ 1292 卿学姐种花 暴力 分块 线段树
卿学姐种花 题目连接: http://acm.uestc.edu.cn/#/problem/show/1292 Description 众所周知,在喵哈哈村,有一个温柔善良的卿学姐. 卿学姐喜欢和她一 ...
- hdu 4027 Can you answer these queries? 线段树区间开根号,区间求和
Can you answer these queries? Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/sho ...
- openCV+ASM+LBP+Gabor实现人脸识别(GT人脸库)
原理:使用GT人脸库做样本,VS2010下使用openCV2.44自带的Haar算法检測人脸区域,ASM Library特征检測,然后使用YCrCb颜色空间做肤色检測,再用LBP+Gabor小波提取特 ...
- IDA Pro plug-in defines
/* This file contains definitions used by the Hex-Rays decompiler output. It has type definitions an ...
- Surface Mount Package Details
http://www.centralsemi.com/product/packages/index2.php http://www.infineon.com/cms/cn/product/packag ...