RHEL7使用systemctl管理服务
|
systemctl命令
|
说明
|
|
systemctl start [unit type]
|
启动服务
|
|
systemctl stop [unit type]
|
停止服务
|
|
systemctl restart [unit type]
|
重启服务
|
- status:参数来查看服务运行情况
- reload:重新加载服务,加载更新后的配置文件(并不是所有服务都支持这个参数,比如network.service)
|
systemctl命令
|
说明
|
|
systemctl enable [unit type]
|
设置服务开机启动
|
|
systemctl disable [unit type]
|
设备服务禁止开机启动
|
|
systemctl命令
|
说明
|
|
systemctl
|
列出所有的系统服务
|
|
systemctl list-units
|
列出所有启动unit
|
|
systemctl list-unit-files
|
列出所有启动文件
|
|
systemctl list-units –type=service –all
|
列出所有service类型的unit
|
|
systemctl list-units –type=service –all grep cpu
|
列出 cpu电源管理机制的服务
|
|
systemctl list-units –type=target –all
|
列出所有target
|
|
systemctl命令
|
说明
|
|
systemctl is-active [unit type]
|
查看服务是否运行
|
|
systemctl is-enable [unit type]
|
查看服务是否设置为开机启动
|
|
systemctl mask [unit type]
|
注销指定服务
|
|
systemctl unmask [unit type]
|
取消注销指定服务
|
|
init命令
|
systemctl命令
|
说明
|
|
init 0
|
systemctl poweroff
|
系统关机
|
|
init 6
|
systemctl reboot
|
重新启动
|
|
systemctl命令
|
说明
|
|
systemctl suspend
|
进入睡眠模式
|
|
systemctl hibernate
|
进入休眠模式
|
|
systemctl rescue
|
强制进入救援模式
|
|
systemctl emergency
|
强制进入紧急救援模式
|
|
init级别
|
systemctl target
|
|
0
|
shutdown.target
|
|
1
|
emergency.target
|
|
2
|
rescure.target
|
|
3
|
multi-user.target
|
|
4
|
无
|
|
5
|
graphical.target
|
|
6
|
无
|
- get-default :取得当前的target
- set-default :设置指定的target为默认的运行级别
- isolate :切换到指定的运行级别
- unit.target :为5.1表中列出的运行级别
|
systemctl命令
|
说明
|
|
systemctl get-default
|
获得当前的运行级别
|
|
systemctl set-default multi-user.target
|
设置默认的运行级别为mulit-user
|
|
systemctl isolate multi-user.target
|
在不重启的情况下,切换到运行级别mulit-user下
|
|
systemctl isolate graphical.target
|
在不重启的情况下,切换到图形界面下
|
|
systemctl Command
|
Description
|
|
systemctl halt
|
Halt the system.
|
|
systemctl hibernate
|
Put the system into hibernation.
|
|
systemctl hybrid-sleep
|
Put the system into hibernation and suspend its operation.
|
|
systemctl poweroff
|
Halt and power off the system.
|
|
systemctl reboot
|
Reboot the system.
|
|
systemctl suspend
|
Suspend the system.
|
RHEL7使用systemctl管理服务的更多相关文章
- Linux_CentOS 中systemctl 管理服务、防火墙 firewalld 以及 SELinux 配置
使用 systemctl 管理服务 systemctl 就是 service 和 chkconfig 这两个命令的整合,在 CentOS 7 就开始被使用了,systemctl是系统服务管理器命令,它 ...
- 二进制编译安装nginx并加入systemctl管理服务
一.安装nginx所需环境 # yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel -y 二.安装ngi ...
- Linux学习-透过 systemctl 管理服务
透过 systemctl 管理单一服务 (service unit) 的启动/开机启动与观察状态 一般来说,服务的启动有两个阶段,一 个是『开机的时候设定要不要启动这个服务』, 以及『你现在要不要启动 ...
- 使用 Centos 7 的 systemctl 管理服务
CentOS 7的服务systemctl脚本存放在:/usr/lib/systemd/,有系统(system)和用户(user)之分,像需要开机不登陆就能运行的程序,存系统服务里即:/usr/lib/ ...
- 使用systemctl管理服务
系统服务,开机不需要登录就能运行的程序(相当于开机自启)/usr/lib/systemd/system 用户服务,需要登录后才能运行的程序/usr/lib/systemd/user 目录下又存在两种类 ...
- CentOS7下普通账号通过systemctl管理服务需要输入root密码问题
问题描述: 使用普通账号test通过systemctl启动系统服务提示需要输入root密码: 解决方案: 根据上面提示得知权限由polkit进行管理,对应的是org.freedesktop.syste ...
- CentOS7 使用systemctl来管理服务
1.建立service文件 以tomcat为例 , 建立tomcat.service文件 #服务说明 [Unit] #服务描述 Description=Tomcat Service #前置需要启动的服 ...
- 手动编译安装Libvirt之后利用systemctl管理libvirtd服务
因为要给特殊的虚拟机关联文件指定selinux标签,而默认的Libvirt没有这个功能,所以需要修改LIbvirt源代码,重新编译安装Libvirt,而手动编译安装的LIbvirt,没有办法使用sys ...
- 透过systemctl管理mysqld服务
1. 背景 CentOS 7.x 之前的版本,系统启动时,第一支呼叫的程序是 init ,然后 init 去唤起所有的系统所需要的服务,无论是本地服务还是网络服务.所有的服务启动脚本都放置于 /etc ...
随机推荐
- Kotlin 的函数定义和使用 (译文 转)
Kotlin 的函数定义和使用 函数声明Kotlin 中的函数使用 fun 关键字声明 fun double(x: Int): Int {}函数用法调用函数使用传统的方法 val result = d ...
- Mysql 基础操作命令
1,查看mysql的建表语句 show create table tableName; #tableName 库中已存在的表名
- [C#菜鸟]C# Hook (二) 常用钩子的类型
; //监视和记录输入事件.安装一个挂钩处理过程,对寄送至系统消息队列的输入消息进行纪录 ; //回放用WH_JOURNALRECORD记录事件 ; //键盘钩子,键盘触发消息.WM_KEYUP或WM ...
- php实现:当未登录时转到登陆页面
判断session是否存在,不存在则跳转到登录页面session_start(); if ( !$_SESSION['xxx'] ) { header("Location: login ...
- CSS二级菜单
0.需求:当鼠标hover到按钮上时,出现下拉菜单导航条. 1.问题拆解: (1)HTML应该如何组织比较方便合理 因为题中要求下拉菜单位于按钮的正下方,可以使用列表<li>中嵌套无序列表 ...
- [Python]if语句的练习
习题: 小明身高1.75,体重80.5kg.请根据BMI公式(体重除以身高的平方)帮小明计算他的BMI指数,并根据BMI指数:低于18.5:过轻 18.5-25:正常 25-28:过重 28-32:肥 ...
- PyQt4 Python GUI窗体应用程序
目录 目录 前言 软件环境 PyQT简介 Setup PyCharm Setup SIP Setup PyQt4 测试PyQt是否安装成功 常见错误 最后 前言 还是一句老话,公司要什么我就做什么.这 ...
- 想使用 MongoDB ,你应该了解这8个方面!
想使用 MongoDB ,你应该了解这8个方面! 应用性能高低依赖于数据库性能,MongoDB 是一个基于分布式文件存储的数据库.由 C++ 语言编写,旨在为 WEB 应用提供可扩展的高性能数据存储解 ...
- ntp同步报错解决
服务端:192.168.1.204 主机名: www.test.com 客户端:192.168.1.206 主机名: www.test3.com 客户端同步服务端报错如下: [root@www etc ...
- Redis 入门 3.3 散列类型
3.3.1 介绍 散列类型(hash)的键值也是一种字典结构,其储存了字段(field)和字段值的映射,但字段值只能是字符串,不支持其他数据类型,换句话说,散列类型不能嵌套其他的数据类型.一个散列 ...