systemctl

相关命令:service,chkconfig

systemd 是 Linux 下的一款系统和服务管理器,兼容 SysV 和 LSB 的启动脚本。systemd 的特性有:支持并行化任务;同时采用 socket 式与 D-Bus 总线式激活服务;按需启动守护进程(daemon);利用 Linux 的 cgroups 监视进程;支持快照和系统恢复;维护挂载点和自动挂载点;各服务间基于依赖关系进行精密控制。

任务	旧指令	新指令
使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service
使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service
检查服务状态 service httpd status systemctl status httpd.service (服务详细信息) systemctl is-enabled httpd.service (仅显示是否 Active)
显示所有已启动的服务 chkconfig --list systemctl list-units --type=service
启动某服务 service httpd start systemctl start httpd.service
停止某服务 service httpd stop systemctl stop httpd.service
重启某服务 service httpd restart systemctl restart httpd.service
某服务重新加载配置文件 service httpd reload systemctl reload httpd.service
# systemctl				#输出已激活单元

# systemctl list-units		#输出已激活单元

# systemctl --failed			#输出运行失败的单元

# systemctl list-unit-files		#查看所有已安装服务

# systemctl start nginx		#启动nginx

# systemctl stop nginx		#停止nginx

# systemctl restart nginx		#重启nginx

# systemctl reload nginx		#重新加载nginx配置

# systemctl status nginx		#输出nginx运行状态

# systemctl is-enabled nginx	#检查nginx是否配置为自动启动

# systemctl enable nginx		#开机自动启动nginx

# systemctl disable nginx		#取消开机自动启动nginx

# systemctl help nginx		#显示nginx的手册页

# systemctl daemon-reload		#重新载入 systemd,扫描新的或有变动的单元

# systemctl reboot			#重启

# systemctl poweroff			#退出系统并停止电源

# systemctl suspend			#待机

# systemctl hibernate		#休眠

# systemctl hybrid-sleep		#混合休眠模式(同时休眠到硬盘并待机

# systemctl isolate graphical.target	#等价于telinit 3 或 telinit 5

systemctl 相关命令的更多相关文章

  1. Systemd程序及相关命令

    Systemd程序及相关命令 Systemd是一款用于Linux操作系统系统管理和服务管理的工具.它向后兼容SysV init脚本,并且支持许多类似于startup系统服务的功能,比如系统快照(sna ...

  2. linux centos7 防火墙及端口开放相关命令

    一.防火墙相关命令 1.查看防火墙状态 : systemctl status firewalld.service 注:active是绿的running表示防火墙开启 2.关闭防火墙 :systemct ...

  3. linux:相关命令以及笔记

    首先,在linux 或者 unix里没有任何的反馈就叫成功,例如: (1)命令执行成功的样子:返回了登录用户信息 (2)命令执行失败的样子:没有返回任何东西 1.按键出现状况 解决:可以使用ctrl+ ...

  4. Linux网络——配置防火墙的相关命令

    Linux网络——配置防火墙的相关命令 摘要:本文主要学习了如何在Linux系统中配置防火墙. iptables命令 iptables准确来讲并不是防火墙,真正的防火墙是运行于系统内核中的netfil ...

  5. linux安装mysql以及修改密码和重启mysql等相关命令

    Linux/UNIX 上安装 MySQL Linux平台上推荐使用RPM包来安装Mysql,MySQL AB提供了以下RPM包的下载地址: MySQL - MySQL服务器.你需要该选项,除非你只想连 ...

  6. Docker容器化【Docker镜像与容器相关命令】

    # Docker 学习目标: 掌握Docker基础知识,能够理解Docker镜像与容器的概念 完成Docker安装与启动 掌握Docker镜像与容器相关命令 掌握Tomcat Nginx 等软件的常用 ...

  7. linux 搜索相关命令(2)

    文件搜索相关命令 1:locate命令 需要 yum install mlocate locate 文件名 在后台数据库中按文件名搜索,搜索速度更快 /var/lib/mlocate #locate命 ...

  8. 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令

    Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...

  9. linux 目录结构及其相关命令

    目录也是一个文件,它的唯一功能是用来保存文件及其相关信息.所有的文件,包括普通文件.设备文件和目录文件,都会被保存到目录中. 主目录 登录后,你所在的位置就是你的主目录(或登录目录),如果是root用 ...

随机推荐

  1. mesos,marathon,haproxy on centos7 最完美安装教程

    前言 本教程参考 http://blog.51cto.com/11863547/1903532 http://blog.51cto.com/11863547/1903532 官方文档等... 系统:c ...

  2. Sass--传多个参数

    Sass 混合宏除了能传一个参数之外,还可以传多个参数,如: @mixin center($width, $height) { width: $width; height: $height; posi ...

  3. Center os6.5设置静态ip

    DEVICE="eth0"BOOTPROTO=staticHWADDR="00:0C:29:95:89:35"IPV6INIT="yes"N ...

  4. CF240E Road Repairs

    最小树形图+输出方案 输出方案的话记录一下哪些边 然后记得最后拆环要倒着拆就行了

  5. Java类加载顺序练习题

    一.题目 public class Test { public static Test t1 = new Test();// 标记1 // 普通代码块 { System.out.println(&qu ...

  6. java连接远程服务器并执行命令

    导入必要的jar包 <dependency>  <groupId>ch.ethz.ganymed</groupId> <artifactId>ganym ...

  7. S1 Python 基础

    定义规范 声明变量 name = "Alex Li" 变量定义规则 变量名只能是 字母.数字或下划线的任意组合 变量名的第一个字符不能是数字 以下关键字不能声明为变量名['and' ...

  8. java并发编程笔记(十一)——高并发处理思路和手段

    java并发编程笔记(十一)--高并发处理思路和手段 扩容 垂直扩容(纵向扩展):提高系统部件能力 水平扩容(横向扩容):增加更多系统成员来实现 缓存 缓存特征 命中率:命中数/(命中数+没有命中数) ...

  9. 测开之路五十:monggodb安装与初步使用

    mongodb下载地址:https://www.mongodb.com/download-center Robo3T下载地址:https://robomongo.org/ 安装mongodb 双击无脑 ...

  10. 项目搭建(一):windows UIAutomation API 框架

    [环境] 操作系统:Windows7 集成环境:Visual Studio2015 编程语言:C# 目标框架:.net framework4.6 1.新建项目 Visual Studio 2015 [ ...