1.

使用 systemctl list-unit-files 可以查看启动项

systemctl list-unit-files | grep enable 过滤查看启动项如下

abrt-ccpp.service                                enabled abrt为auto bug report的缩写 用于bug报告 关闭
abrt-oops.service                                enabled ---------------------- 
abrt-vmcore.service                              enabled ----------------------
abrt-xorg.service                                enabled ----------------------
abrtd.service                                      enabled   ----------------------
auditd.service                                   enabled 安全审计 保留
autovt@.service                               enabled 登陆相关 保留
crond.service                                          enabled 定时任务 保留
dbus-org.freedesktop.NetworkManager.service    enabled 桌面网卡管理 关闭
dbus-org.freedesktop.nm-dispatcher.service         enabled ----------------------
getty@.service                                enabled tty控制台相关 保留
irqbalance.service                          enabled 优化系统中断分配 保留
kdump.service                                enabled 内核崩溃信息捕获 自定
microcode.service                        enabled 处理器稳定性增强 保留
NetworkManager-dispatcher.service              enabled 网卡守护进程 关闭
NetworkManager.service                        enabled ----------------------
postfix.service                            enabled 邮件服务 关闭
rsyslog.service                              enabled 日志服务 保留
snmpd.service                                enabled snmp监控 数据抓取 保留
sshd.service                                  enabled ssh登陆 保留
systemd-readahead-collect.service             enabled 内核调用--预读取 保留
systemd-readahead-drop.service                enabled ----------------------
systemd-readahead-replay.service              enabled ----------------------
tuned.service                                     enabled 
default.target                                 enabled 默认启动项 multi-user.target的软连接 保留
multi-user.target                             enabled 启动用户命令环境 保留
remote-fs.target                               enabled 集合远程文件挂载点 自定
runlevel2.target                              enabled 运行级别 用于兼容6的SysV 保留
runlevel3.target                              enabled ----------------------
runlevel4.target                              enabled ----------------------

关闭一下开机启动服务

systemctl disable abrt-ccpp.service
systemctl disable abrt-oops.service
systemctl disable abrt-vmcore.service
systemctl disable abrt-xorg.service
systemctl disable abrtd.service
systemctl disable accounts-daemon.service
systemctl disable atd.service
systemctl disable auditd.service
systemctl disable autovt@.service
systemctl disable avahi-daemon.service
systemctl disable bluetooth.service
systemctl disable cups.service
systemctl disable dbus-org.bluez.service
systemctl disable dbus-org.fedoraproject.FirewallD1.service
systemctl disable dbus-org.freedesktop.Avahi.service
systemctl disable dbus-org.freedesktop.ModemManager1.service
systemctl disable dbus-org.freedesktop.NetworkManager.service
systemctl disable dbus-org.freedesktop.nm-dispatcher.service
systemctl disable display-manager.service
systemctl disable dmraid-activation.service
systemctl disable firewalld.service
systemctl disable gdm.service
systemctl disable irqbalance.service
systemctl disable iscsi.service
systemctl disable ksm.service
systemctl disable ksmtuned.service
systemctl disable libstoragemgmt.service
systemctl disable libvirtd.service
systemctl disable lvm2-monitor.service
systemctl disable mcelog.service
systemctl disable mdmonitor.service
systemctl disable microcode.service
systemctl disable ModemManager.service
systemctl disable multipathd.service
systemctl disable NetworkManager-dispatcher.service
systemctl disable NetworkManager.service
systemctl disable postfix.service
systemctl disable qemu-guest-agent.service
systemctl disable rngd.service
systemctl disable rtkit-daemon.service
systemctl disable smartd.service
systemctl disable spice-vdagentd.service
systemctl disable systemd-readahead-collect.service
systemctl disable systemd-readahead-drop.service
systemctl disable systemd-readahead-replay.service
systemctl disable tuned.service
systemctl disable vgauthd.service
systemctl disable vmtoolsd.service


2.systemctl 用法:

显示服务状态:systemctl status docker.service

列出服务层级和依赖关系:systemctl list-dependencies docker.service

启动服务:systemctl start docker.service

关闭服务:systemctl stop docker.service

重启服务:systemctl restart docker.service

设置服务自启动:systemctl enable docker.service

禁止服务自启动:systemctl disable docker.service

查看服务是否自启动:systemctl is-enabled docker.service

列出系统所有服务的启动情况:systemctl list-units --type=service

列出所有自启动服务:systemctl list-unit-files|grep enabled

对应的旧指令(chkconfig、service)

显示服务状态:service docker status
列出服务层级和依赖关系:systemctl list-dependencies docker.service 启动服务:service docker start
关闭服务:service docker stop
重启服务:service docker restart 设置服务自启动:chkconfig --level 3 docker on
禁止服务自启动:chkconfig --level 3 docker off 查看服务是否自启动:chkconfig --list docker
列出系统所有服务的启动情况:chkconfig --list

centos 7 开机启动服务项优化的更多相关文章

  1. Ubuntu管理开机启动服务项 -- 图形界面的Boot-up Manager

    有时学习时安装的服务太多,比如mysql.mongodb.redis.apache.nginx等等,它们都是默认开机启动的,如果不想让它们开机启动,用到时再自己手工启动怎么办呢? 使用sysv-rc- ...

  2. (转) CentOS 7添加开机启动服务/脚本

    CentOS 7添加开机启动服务/脚本 原文:http://blog.csdn.net/wang123459/article/details/79063703 一.添加开机自启服务 在CentOS 7 ...

  3. centos 开机启动服务 systemctl

    systemctl 实现开机自启服务 转载起一个好听的名字 最后发布于2018-06-26 13:49:06 阅读数 13473  收藏 展开 systemctl是RHEL 7 的服务管理工具中主要的 ...

  4. Redis加入Centos Linux开机启动

    Redis加入Centos Linux开机启动 网上有很多redis在linux下自动启动的例子,实现的方式很多,很多都是参考一个老外流传出来启动的例子,其实直接使用是不行,而且有很多地方有一些语法错 ...

  5. (转)CentOS下开机启动查看管理命令:chkconfig用法

    CentOS下开机启动查看管理命令:chkconfig用法   CentOS下开机启动查看管理的命令是:chkconfig   1. 开机启动列表查看: chkconfig --list     说明 ...

  6. Hortonworks HDP Sandbox定制(配置)开机启动服务(组件)

    定制Hortonworks HDP开机启动服务能够这样做:本文原文出处: http://blog.csdn.net/bluishglc/article/details/42109253 严禁不论什么形 ...

  7. Centos 配置开机启动脚本启动 docker 容器

    Centos 配置开机启动脚本启动 docker 容器 Intro 我们的 Centos 服务器上部署了好多个 docker 容器,因故重启的时候就会导致还得手动去手动重启这些 docker 容器,为 ...

  8. linux chkconfig添加开机启动服务

    --add:增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据: --del:删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的 ...

  9. centos 7 开机启动配置

    centos 7 开机启动 1 开机启动配置文件位于/usr/lib/systemd/system/ 2 nginx的配置[Unit]Description=nginx - high performa ...

随机推荐

  1. NX二次开发-获取坐标系信息UF_CSYS_ask_csys_info

    NX9+VS2012 #include <uf.h> #include <uf_csys.h> UF_initialize(); //获取WCS标识 tag_t WcsId = ...

  2. Java-Class-@I:org.springframework.web.bind.annotation.RequestBody

    ylbtech-Java-Class-@I:org.springframework.web.bind.annotation.RequestBody 1.返回顶部   2.返回顶部 1. package ...

  3. Typora--终于找到一个能够解决将csdn文章同步到hexo的完美编辑器(解决csdn图片防盗链导致无法直接复制文章的问题)。

    文章目录 需求 背景 新宠 告诉我,我的名字叫什么?大声点我听不见~ 页面 神奇之处 看得见的优点 如何设置项目根目录 如何显示图片? 于是最终操作流程 个人博客:https://mmmmmm.me ...

  4. UVA 12676 Inverting Huffman

    题目链接:https://vjudge.net/problem/UVA-12676 题目大意 一串文本中包含 N 个不同字母,经过哈夫曼编码后,得到这 N 个字母的相应编码长度,求文本的最短可能长度. ...

  5. Spring Boot 整合 Shiro+Thymeleaf

    1.导包 <!-- springboot 与 shiro 的集成--> <dependency> <groupId>org.apache.shiro</gro ...

  6. 【洛谷】P1962

    题目链接:https://www.luogu.org/problemnew/show/P1962 题意:求fib数列的第n项,很大.mod 1e9+7. 题解:BM直接推. 代码: #include ...

  7. System.arraycopy复制数组方法解释

    **/* * @param src the source array.源数组 * @param srcPos starting position in the source array.源数组要复制的 ...

  8. Java类加载器浅述

    jdk默认提供了三种类加载器: 1.Bootstrap ClassLoader(引导类加载器): 将<JAVA_HOME>\lib目录下的类库加载到虚拟机内存中,用来加载java的核心库, ...

  9. mui--使用mui中的图文表格组件时出现一条横线的解决方法

    最近做的微信公众号点击链接跳转到H5页面,该H5页面使用mui做的,遇到的商品列表页出现一个横线的问题, 这个是修改前的图片 解决方法: <style type="text/css&q ...

  10. 关于DB9一些信号的缩写

    https://www.cnblogs.com/CCJVL/archive/2010/02/04/1663565.html 场景:PCB板子与PC通过RS232连接,以下信号的方向相对于PCB板子而言 ...