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 ...
随机推荐
- vue-preview 缩略图
如果我们在 vue 中想使用缩略图的话,可以使用 vue-preview 的插件 小图的缩略 大图的样式 使用方法:vue-preview 下 载: npm i vue-preview 使用方法 ...
- ffmpeg修复时间戳
ffmpeg -re -i e:/media/baifa.mp4 -filter_complex -hls_wrap -hls_time d:/demo/hls/cctv13/playlist.m3u ...
- MySQL MGR 单主模式下master角色切换规则
MGR单主模式,master节点可读可写,其余节点都是只读.当配置MGR为单主模式,非master节点自动开启super_read_only 当可读可写的节点异常宕机,会进行怎样的切换?在选择新的可写 ...
- Android Context完全解析与各种获取Context方法
Context类型 我们知道,Android应用都是使用Java语言来编写的,那么大家可以思考一下,一个Android程序和一个Java程序,他们最大的区别在哪里?划分界限又是什么呢?其实简单点分析, ...
- Activity 怎么和 Service 绑定,怎么在 Activity 中启动自己对应的 Service?
Activity 通过 bindService(Intent service, ServiceConnection conn, int flags)跟 Service 进行绑定,当绑定成功的时候 Se ...
- git使用遇到的问题
1.我新建了一个django项目,然后又在git上新建了一个仓库,然后我在django的项目文件内,将git上的项目clone到这个文件内的时候 git clone https://gitee.com ...
- 文件分发服务器 AWS CloudFront(CDN)使用入门-以S3为例 Lebal:Research
引言 在互联网上随意右击一张图片,都可以发现复制图片地址这个选项,这说明他们都有自己的链接(直链),也就是说我们可以通过一个链接本身来访问图片.代码等文件,而不是打开一个网页再选择复制,这就和下载链接 ...
- 慕课网_Java Socket应用---通信是这样练成的
第1章 网络基础知识 1-1 网络基础简介 (10:21) 第2章 Java 中网络相关 API 的应用 2-1 Java 中的 InetAddress 的应用 (08:10) import java ...
- LeetCode.1047-重复删除字符串中的所有相邻重复项
这是小川的第389次更新,第419篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第251题(顺位题号是1047).给定一个小写字母的字符串S,重复删除两个相邻且相等的字母 ...
- Linux 的简单命令以及在idea中配置码云
Linux 的简单命令: ls(list)功能:列出目录内容 cd(change directory)功能:切换目录 touch 1.txt 在当前目录创建一个文件1.txt clear:清除屏幕 p ...