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. JS对象的可枚举属性和不可枚举属性

    昨天在写文章(转载)的时候发现了有些对象的方法是分可枚举性和不可枚举性的.简单的查了一下资料,今天来捋一捋啥是对象的可枚举啥是不可枚举. 可枚举性: 对象的每一个属性都有一个描述对象,用来描述和控制该 ...

  2. Python-爬虫-requests库用语post登录

    requests库很强大,支持HTTP连接保持和连接池,支持使用cookie保持会话,支持文件上传,支持自动确定响应内容的编码,支持国际化的URL和POST数据自动编码. 可以发送无参数的get请求, ...

  3. 使用bash关联数组统计单词

    使用bash关联数组统计单词 从bash 4开始支持关联数组,使用前需要声明,即 declare -A map map[key1]=value1 map[key2]=value2 map=([key1 ...

  4. decimate、end、interp、resample工具箱函数

  5. 3.2_springBoot2.1.x检索之JestClient操作ElasticSearch

    这里介绍Jest方式交互, 导入jest版本 <!--导入jest--> <dependency> <groupId>io.searchbox</groupI ...

  6. 6-Python操作MySQL-增(insert)-删(delete)-改(update)-查(select)

    增删改 from pymysql import * def main(): # 创建Connection连接 conn = connect(host='localhost',port=3306,dat ...

  7. Spring+SpringMVC+MyBatis+SpringSecurity+EhCache+JCaptcha 完整Web基础框架(前言)

    简单介绍一下,本框架的基本功能点: Spring:整个框架的主体部分,这个自不用说. SpringMVC:MVC部分我还是比较喜欢Spring的. MyBatis:选型的时候选择这个ORM主要也是考虑 ...

  8. Visual Studio 2010 启动调试报错 “访问OLE注册表的错误”

    错误:访问OLE注册表的错误(异常来自HRESULT:0x8002801C(TYPE_E_REGISTRYACCESS)) 很简单,其实只要 “以管理员身份运行” Visual Studio即可.

  9. springboot配置多数据源mybatis配置失效问题

    mybatis配置 #开启驼峰映射 mybatis.configuration.map-underscore-to-camel-case=true #开启打印sql mybatis.configura ...

  10. Centos7 pxe

    yum install dnsmasq mv /etc/dnsmasq.conf /etc/dnsmasq.conf.backup # vim /etc/dnsmasq.conf interface= ...