[root@bogon rsyslog.d]# systemctl is-enabled httpd
disabled
[root@bogon rsyslog.d]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8) Jun 26 04:51:42 bogon systemd[1]: httpd.service failed.
Jun 26 04:53:28 bogon systemd[1]: Starting The Apache HTTP Server...
Jun 26 04:53:29 bogon httpd[9652]: AH00558: httpd: Could not reliably determine the...age
Jun 26 04:53:29 bogon systemd[1]: Started The Apache HTTP Server.
Jun 26 05:38:31 bogon systemd[1]: Stopping The Apache HTTP Server...
Jun 26 05:38:32 bogon systemd[1]: Starting The Apache HTTP Server...
Jun 26 05:38:33 bogon httpd[12171]: AH00558: httpd: Could not reliably determine th...age
Jun 26 05:38:33 bogon systemd[1]: Started The Apache HTTP Server.
Jun 26 06:20:03 bogon systemd[1]: Stopping The Apache HTTP Server...
Jun 26 06:20:04 bogon systemd[1]: Stopped The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@bogon rsyslog.d]# systemctl start httpd #开启自启动
[root@bogon rsyslog.d]# systemctl status httpd #查看服务当前状态
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2017-06-26 07:56:27 PDT; 4s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 15508 (httpd)
Status: "Processing requests..."
CGroup: /system.slice/httpd.service
├─15508 /usr/sbin/httpd -DFOREGROUND
├─15509 /usr/sbin/httpd -DFOREGROUND
├─15510 /usr/sbin/httpd -DFOREGROUND
├─15511 /usr/sbin/httpd -DFOREGROUND
├─15512 /usr/sbin/httpd -DFOREGROUND
└─15513 /usr/sbin/httpd -DFOREGROUND Jun 26 07:56:25 bogon systemd[1]: Starting The Apache HTTP Server...
Jun 26 07:56:26 bogon httpd[15508]: AH00558: httpd: Could not reliably determine th...age
Jun 26 07:56:27 bogon systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@bogon rsyslog.d]# systemctl stop httpd #禁止自启动
[root@bogon rsyslog.d]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8) Jun 26 05:38:32 bogon systemd[1]: Starting The Apache HTTP Server...
Jun 26 05:38:33 bogon httpd[12171]: AH00558: httpd: Could not reliably determine th...age
Jun 26 05:38:33 bogon systemd[1]: Started The Apache HTTP Server.
Jun 26 06:20:03 bogon systemd[1]: Stopping The Apache HTTP Server...
Jun 26 06:20:04 bogon systemd[1]: Stopped The Apache HTTP Server.
Jun 26 07:56:25 bogon systemd[1]: Starting The Apache HTTP Server...
Jun 26 07:56:26 bogon httpd[15508]: AH00558: httpd: Could not reliably determine th...age
Jun 26 07:56:27 bogon systemd[1]: Started The Apache HTTP Server.
Jun 26 07:56:35 bogon systemd[1]: Stopping The Apache HTTP Server...
Jun 26 07:56:36 bogon systemd[1]: Stopped The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@bogon rsyslog.d]# systemctl start httpd
[root@bogon rsyslog.d]# systemctl restart httpd
[root@bogon rsyslog.d]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@bogon rsyslog.d]# systemctl is-enabled httpd #查询是否自启动
enabled
[root@bogon rsyslog.d]# systemctl disable httpd #禁止自启动
Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service.
[root@bogon rsyslog.d]# systemctl is-enabled httpd
disabled
[root@bogon rsyslog.d]# systemctl list-unit-files|grep enabled #查看自启动服务列表
abrt-ccpp.service enabled
abrt-oops.service enabled
abrt-vmcore.service enabled
abrt-xorg.service enabled
abrtd.service enabled
accounts-daemon.service enabled
atd.service enabled
auditd.service enabled
autovt@.service enabled
avahi-daemon.service enabled
chronyd.service enabled
crond.service enabled
dbus-org.fedoraproject.FirewallD1.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service enabled
dmraid-activation.service enabled
firewalld.service enabled
gdm.service enabled
getty@.service enabled
irqbalance.service enabled
iscsi.service enabled
kdump.service enabled
ksm.service enabled
ksmtuned.service enabled
libstoragemgmt.service enabled
libvirtd.service enabled
lvm2-monitor.service enabled
mdmonitor.service enabled
microcode.service enabled
ModemManager.service enabled
multipathd.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled
postfix.service enabled
qemu-guest-agent.service enabled
rngd.service enabled
rsyslog.service enabled
rtkit-daemon.service enabled
smartd.service enabled
spice-vdagentd.service enabled
sshd.service enabled
sysstat.service enabled
systemd-readahead-collect.service enabled
systemd-readahead-drop.service enabled
systemd-readahead-replay.service enabled
tuned.service enabled
vmtoolsd.service enabled
xinetd.service enabled
avahi-daemon.socket enabled
dm-event.socket enabled
iscsid.socket enabled
iscsiuio.socket enabled
lvm2-lvmetad.socket enabled
lvm2-lvmpolld.socket enabled
rpcbind.socket enabled
virtlockd.socket enabled
virtlogd.socket enabled
default.target enabled
graphical.target enabled
nfs-client.target enabled
remote-fs.target enabled
runlevel5.target enabled
[root@bogon rsyslog.d]#

还有基于运行级别上的设置,例如在图形模式下启动httpd,但是在命令行模式下禁止自启httpd等。以后会补充进来

Centos7禁止或者允许开机启动服务的更多相关文章

  1. Centos7.x:开机启动服务的配置和管理

    一.开机启动服务的配置 1.创建服务配置(权限754) vim /usr/lib/systemd/system/nginx.service 文件内容解释 [Unit]:服务的说明Description ...

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

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

  3. Linux的运行级别和设置开机启动服务的方式

    Linux的运行级别 什么是运行级别呢?简单点来说,运行级别就是操作系统当前正在运行的功能级别.级别是从0到6,具有不同的功能.这些级别定义在/ect/inittab文件中.这个文件是init程序寻找 ...

  4. centos 7 开机启动服务项优化

    1. 使用 systemctl list-unit-files 可以查看启动项 systemctl list-unit-files | grep enable 过滤查看启动项如下 abrt-ccpp. ...

  5. centos7也支持service命令启动服务吗,对于centos7 中的systemctl和旧的service命令的区别和联系

    一.centos7也支持service命令启动服务吗 CentOS 7.0中一个最主要的改变,就是切换到了systemd.它用于替代红帽企业版Linux前任版本中的SysV和Upstart,对系统和服 ...

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

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

  7. centos7安装redis设置开机启动

    1. 首先下载redis源码,并使用tar进行解压缩 wget http://download.redis.io/releases/redis-4.0.8.tar.gztar xvzf redis-4 ...

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

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

  9. linux自定义开机启动服务和chkconfig使用方法

    linux自定义开机启动服务和chkconfig使用方法 1. 服务概述在linux操作系统下,经常需要创建一些服务,这些服务被做成shell脚本,这些服务需要在系统启动的时候自动启动,关闭的时候自动 ...

随机推荐

  1. 无法卸载Sql Server 的解决办法

    提示如下: 解决办法: 命令提示符——>wmic——>product list 找到与Sql Server 有关的程序: 重新打开一个命令提示符: 执行卸载命令:msiexec /x {7 ...

  2. AOP 实现自定义注解

    1.自定义注解2.编写 AOP3.测试 1.自定义注解 package com.base.yun.spring.aop; import java.lang.annotation.Documented; ...

  3. Office 365 企业应用以及服务概览 分享记录

    博客地址:http://blog.csdn.net/FoxDave 分享时间: 2017年9月14日 分享地点: 部门内部 参与人数: 16人 分享内容: 讲解微软MVP项目计划的相关内容:讲解O ...

  4. python23的区别-日常记录

    1. xrange:python3 中取消了range函数,把python2中的xrange重新命名为range,所以在python3中直接用range就行. 2. print:python3中pri ...

  5. 位(bit)、字节(Byte)、MB(兆位)之间的换算关系

    B是Byte的缩写,意思是字节:b是bit的缩写,意思是比特位:Kb是千比特位,KB是千字节:MB意思是兆字节: 换算关系: 1MB=1024KB=1024B*1024=1048576B: 8bit= ...

  6. http 请求头部解析

    作者:知乎用户链接:https://www.zhihu.com/question/42696895/answer/109035792来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...

  7. vuejs中v-bind绑定class时的注意事项

    关于v-bind绑定class的实例 作用:可用于不同样式之间的切换 <!DOCTYPE html> <html lang="en"> <head&g ...

  8. 【转载】Vue项目自动转换 px 为 rem,高保真还原设计图

    前端开发中还原设计图的重要性毋庸置疑,目前来说应用最多的应该也还是使用rem.然而很多人依然还是处于刀耕火种的时代,要么自己去计算rem值,要么依靠编辑器安装插件转换. 而本文的目标就是通过一系列的配 ...

  9. rem问题

    rem为单位时,根元素html的font-size 必须>=12px,否则 默认为font-size:12px. 为啥 html 设置成 62.5%,或者 10px 时,这种换算无效了呢?经过研 ...

  10. Spring Boot 揭秘与实战(二) 数据缓存篇 - Redis Cache

    文章目录 1. Redis Cache 集成 2. 源代码 本文,讲解 Spring Boot 如何集成 Redis Cache,实现缓存. 在阅读「Spring Boot 揭秘与实战(二) 数据缓存 ...