systemctl centos fedora 用法
LinuxSystemctl是一个系统管理守护进程、工具和库的集合,用于取代System V、service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器。通过Systemctl –help可以看到该命令主要分为:查询或发送控制命令给systemd服务,管理单元服务的命令,服务文件的相关命令,任务、环境、快照相关命令,systemd服务的配置重载,系统开机关机相关的命令。
1. 列出所有可用单元
# systemctl list-unit-files
2. 列出所有运行中单元
# systemctl list-units
3. 列出所有失败单元
# systemctl –failed
4. 检查某个单元(如 crond.service)是否启用
# systemctl is-enabledcrond.service
5. 列出所有服务
# systemctl list-unit-files –type=service
6. Linux中如何启动、重启、停止、重载服务以及检查服务(如 httpd.service)状态
# systemctl start httpd.service
# systemctl restart httpd.service
# systemctl stop httpd.service
# systemctl reload httpd.service
# systemctl status httpd.service
注意:当我们使用systemctl的start,restart,stop和reload命令时,终端不会输出任何内容,只有status命令可以打印输出。
7. 如何激活服务并在开机时启用或禁用服务(即系统启动时自动启动mysql.service服务)
# systemctl is-active mysql.service
# systemctl enable mysql.service
# systemctl disable mysql.service
8. 如何屏蔽(让它不能启动)或显示服务(如ntpdate.service)
# systemctl mask ntpdate.service
ln -s ‘/dev/null”/etc/systemd/system/ntpdate.service’
# systemctl unmask ntpdate.service
rm ‘/etc/systemd/system/ntpdate.service’
9. 使用systemctl命令杀死服务
# systemctl killcrond
10. 列出所有系统挂载点
# systemctl list-unit-files –type=mount
11. 挂载、卸载、重新挂载、重载系统挂载点并检查系统中挂载点状态
# systemctl start tmp.mount
# systemctl stop tmp.mount
# systemctl restart tmp.mount
# systemctl reload tmp.mount
# systemctl status tmp.mount
12. 在启动时激活、启用或禁用挂载点(系统启动时自动挂载)
# systemctl is-active tmp.mount
# systemctl enable tmp.mount
# systemctl disable tmp.mount
13. 在Linux中屏蔽(让它不能启用)或可见挂载点
# systemctl mask tmp.mount
ln -s ‘/dev/null”/etc/systemd/system/tmp.mount’
# systemctl unmask tmp.mount
rm ‘/etc/systemd/system/tmp.mount’
14. 列出所有可用系统套接口
# systemctl list-unit-files –type=socket
15. 检查某个服务的所有配置细节
# systemctl showmysql
16. 获取某个服务(httpd)的依赖性列表
# systemctl list-dependencies httpd.service
17. 启动救援模式
# systemctl rescue
18. 进入紧急模式
# systemctl emergency
19. 列出当前使用的运行等级
# systemctl get-default
20. 启动运行等级5,即图形模式
# systemctl isolate runlevel5.target
或
# systemctl isolate graphical.target
21. 启动运行等级3,即多用户模式(命令行)
# systemctl isolate runlevel3.target
或
# systemctl isolate multiuser.target
22. 设置多用户模式或图形模式为默认运行等级
# systemctl set-default runlevel3.target
# systemctl set-default runlevel5.target
23. 重启、停止、挂起、休眠系统或使系统进入混合睡眠
# systemctl reboot
# systemctl halt
# systemctl suspend
# systemctl hibernate
# systemctl hybrid-sleep
对于不知运行等级为何物的人,说明如下。
Runlevel 0 : 关闭系统
Runlevel 1 : 救援,维护模式
Runlevel 3 : 多用户,无图形系统
Runlevel 4 : 多用户,无图形系统
Runlevel 5 : 多用户,图形化系统
Runlevel 6 : 关闭并重启机器
systemctl centos fedora 用法的更多相关文章
- Centos7 环境下开机 自启动服务(service) 设置的改变 (命令systemctl 和 chkconfig用法区别比较)
参考文章: <Linux 设置程序开机自启动 (命令systemctl 和 chkconfig用法区别比较)> http://blog.csdn.net/kenhins/article/ ...
- RHEL/CentOS/Fedora各种源(EPEL、Remi、RPMForge、RPMFusion)配置
最新文章:Virson’s Blog CentOS默认自带CentOS-Base.repo源,但官方源中去除了很多有版权争议的软件,而且安装的软件也不是最新的稳定版.Fedora自带的源中也找不到很多 ...
- Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux
Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux¶ Overview Use this tutorial t ...
- RHEL/CentOS/Fedora常用的 CentOS 5/6/7 yum 源(EPEL、Remi、RPMForge、RPMFusion, ius,163,sohu,阿里云)配置
RHEL以及他的衍生发行版如CentOS.Scientific Linux为了稳定,官方的rpm repository提供的rpm包往往是很滞后的,当然了,这样做这是无可厚非的,毕竟这是服务器版本,安 ...
- 使用 ISO镜像配置 本地yum 源(RHEL, CentOS, Fedora等适用)
使用 ISO镜像配置 本地yum 源(RHEL, CentOS, Fedora等适用) 1.上传ISO镜像和挂载 1) 上传Centos7.2 ISO镜像到 /usr/local/src目录 2) ...
- RHEL/CentOS/Fedora各种源
CentOS 默认自带 CentOS-Base.repo 源, 但官方源中去除了很多有版权争议的软件, 而且安装的软件也不是最新的稳定版. Fedora 自带的源中也找不到很多多媒体软件, 如果需要安 ...
- Docker运行操作系统环境(BusyBox&Alpine&Debian/Ubuntu&CentOS/Fedora)
目前常用的Linux发行版主要包括Debian/Ubuntu系列和CentOS/Fedora系列.前者以自带软件包版本较新而出名:后者则宣称运行更稳定一些.选择哪个操作系统取决于读者的具体需求.同时, ...
- RHEL CentOS Fedora各种源介绍和安装
CentOS默认自带CentOS-Base.repo源,但官方源中去除了很多有版权争议的软件,而且安装的软件也不是最新的稳定版. 下面介绍各种第三方软件库,以下软件库适用于与RHEL完全兼容的li ...
- centos/Fedora/RHEL 安全设置
centos/Fedora/RHEL • 整改方法: • 验证检查: 1.查看/etc/login.defs,访谈询问当前所设置的密码长度及更换周期: 2.查看/etc/pam.d ...
随机推荐
- 【javascript】数据结构-链表
// 创建一个链表 function LinkedList(){ // 创建一个Node辅助类,表示需要加入列表的项,它包含一个element属性,即表示需要加入到列表中的值,next属性表示指向下一 ...
- 浅入浅出JS中的eval及json
声明: 首先声明一下,本人是JS新手,所以不敢说深入,只是把最近对eval的学习经验拿出来跟大家分享,如果您是高手可略去不看. 适合读者: 对JS中的eval一知半解,不知eval是如何把字符串转换为 ...
- linux下安装微信小程序开发工具
一.环境:: ubuntu 16.04 二.安装过程: 2.1 安装wine sudo apt-get install wine 2.2 安装nwjs-sdk 2.2.1 下载linux版nwjs-s ...
- Java中++,--,前缀后缀表达值的不同,与^的值计算
package 习题1; /** * ++ -- 与 ^ 的一些计算 * @author SeeClanUkyo * */ public class Test4 { public static voi ...
- HDU 6150 Vertex Cover(构造)
http://acm.hdu.edu.cn/showproblem.php?pid=6150 #include<iostream> #include<algorithm> #i ...
- python ros 关闭节点
def myhook(): print "shutdown time!" rospy.on_shutdown(myhook) 或 rospy.signal_shutdown(rea ...
- Beta冲刺一《WAP团队》
β冲刺第一天 1. 今日完成任务情况以及遇到的问题. ①马麒.杜有海:管理员审核表的完善 ②郝明宇:登录.注册界面的完善 ③马宏伟.周欣:前端数据借用与后台的连接 ④乌勒扎:登录与注册功能的测试 2 ...
- HDU 4489 The King's Ups and Downs
HDU 4489 The King's Ups and Downs 思路: 状态:dp[i]表示i个数的方案数. 转移方程:dp[n]=∑dp[j-1]/2*dp[n-j]/2*C(n-1,j-1). ...
- Codeforces 855B - Marvolo Gaunt's Ring
855B - Marvolo Gaunt's Ring 思路:①枚举a[j],a[i]和a[k]分别用前缀最小值最大值和后缀最小值和后缀最大值确定. ②dp,dp[i][j]表示到第j为止,前i+1个 ...
- spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration
详细错误代码: *************************** APPLICATION FAILED TO START *************************** Descript ...