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二次开发-UFUN工程图初始化视图信息UF_DRAW_initialize_view_info

    NX9+VS2012 #include <uf.h> #include <uf_draw.h> #include <uf_obj.h> #include <u ...

  2. 标准H.460公私网穿越视频解决方案

    一.概述 H.460协议是一种网络通信协议,主要用于音视频的网络穿越,可以解决客户私网到公网,以及公网到私网的互相通信. 大连羽化集团是中国较大的零售业集团之一.目前羽化集团百货店已达20多家,营业面 ...

  3. Spring-Security (学习记录六)--采用ehcache缓存UserDetails

    目录 1. spring-security提供了缓存UserDetails的UserDetailsService实现类. 2. 通过配置来完成缓存 UserDetails (使用ehcache) 3. ...

  4. python从入门到大神---Python的jieba模块简介

    python从入门到大神---Python的jieba模块简介 一.总结 一句话总结: jieba包是分词技术,也就是将一句话分成多个词,有多种分词模型可选 1.分词模块包一般有哪些分词模式(比如py ...

  5. LeetCode刷题笔记-递归-将有序数组转换为二叉搜索树

    题目描述 将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树. 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1. 示例: 给定有序数组: [-10, ...

  6. Codeforce 1175A From Hero to Zero

    题目链接:http://codeforces.com/problemset/problem/1175/A AC代码: #include<cstdio> #include<iostre ...

  7. Spring AOP之xml 配置实现

    首先这个配置模式估计现在已经不用了,因为我在我们公司的项目里面并没有看到这么配置AOP相关的东西.不过,这个就和学习spring的控制反转(IOC)和依赖注入(DI)一样,刚刚开始的时候,都是从简单的 ...

  8. HashMap底层实现原理及面试问题

    ①HashMap的工作原理 HashMap基于hashing原理,我们通过put()和get()方法储存和获取对象.当我们将键值对传递给put()方法时,它调用键对象的hashCode()方法来计算h ...

  9. adb shell top 使用

    adb shell top 一.其中相关参数: >adb shell top -h  Usage: top [ -m max_procs ] [ -n iterations ] [ -d del ...

  10. 使用PyCharm创建Django项目及基本配置

    https://segmentfault.com/a/1190000011576316 pycharm是个很不错的python开发工具,大大缩短了python项目的创建时间以及调试时间在使用pytho ...