CentOS 7.0 systemctl使用说明

简介: centos 7.0  引入了很多心得特性,感觉比较大的是sytemctl 命令的使用。 systemd使用方法: systemd的服务管理程序 systemctl是最主要的工具。
centos 7.0  引入了很多心得特性,感觉比较大的是sytemctl 命令的使用。

systemd使用方法:

systemd的服务管理程序

systemctl是最主要的工具。它融合 service 和chkconfig的功能于一体。你可以使用它永久性或只在当前会话中启用/禁用服务。

下面命令用于列出正在运行的服务或其他: systemctl

更多详细信息请参考手册页(man systemctl)。systemd-cgls以树形列出正在运行的进程。它可以递归显示给定控制组内容。详情请参阅systemd-cgls手册页。

如何启动/关闭、启用/禁用服务?

运行一个服务:

systemctl start network.service 关闭网络服务:

systemctl stop network.service 重启网络服务:

systemctl restart network.service

显示一个服务(无论运行与否)的状态: systemctl status network.service

在开机时启用一个服务: systemctl enable network.service

在开机时禁用一个服务: systemctl disable network.service

查看服务开机是否启动:systemctl is-enabled network.service;echo $?  或者是chkconfig
使用systemctl命令,要记住start,stop,restart,status,enable,disable,is-enabled。就可以很好的使用!

systemd查看开机自启动的程序
相当于chkconfig --list
ls /etc/systemd/system/multi-user.target.wants/
相关文章
|
NoSQL Linux Redis
centos7 systemctl 启动 Redis 失败
转自:http://sloger.info/posts/systemd-failed-to-start-redis-in-gentoo 今天启动 Redis 时阻塞很长时间,之后显示启动失败,启动状态如下。
5587 0
|
Shell Linux 开发工具
CentOS编译和yum安装Beanstalkd及service和systemctl管理
本篇笔记记录了CentOS中编译和yum两种方式安装Beanstalkd的过程,以及在CentOS6中创建服务脚本,使用service管理;CentOS7中创建服务脚本,使用systemctl管理Beanstalkd的过程
3439 0
|
Linux Apache
Centos 7 service 命令的更改,systemctl命令简单实用实例
centos 7 中的类似**"service httpd start"**服务启动,停止,重启指令,**“service”**已更改为**“systemctl”**。具体示例如下: systemctl start httpd.service 启动Apache httpd systemctl
3196 0

热门文章

最新文章