[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. 项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved 解决方法

    Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...

  2. 九. Python基础(9)--命名空间, 作用域

    九. Python基础(9)--命名空间, 作用域 1 ● !a 与 not a 注意, C/C++可以用if !a表示if a == 0, 但是Python中只能用if not a来表示同样的意义. ...

  3. 什么是RUP

    Rational统一过程(Rational  Unified  Process,RUP)是由Rational软件公司推出的一种完整且完美的软件过程. RUP总结了经过多年商业化验证的6条最有效的软件开 ...

  4. 界面控件DevExpress发布v18.2.5|附下载

    DevExpress Universal Subscription(又名DevExpress宇宙版或DXperience Universal Suite)是全球使用广泛的.NET用户界面控件套包,De ...

  5. Java语法基础学习DayTwo

    一.数据类型补充问题 数据类型的自动转换等级: byte,short,char -- int -- long -- float -- double long是8个字节,float是4个字节,为什么是这 ...

  6. mvc Model验证总结及常用正则表达式

    本文属转载,来源: http://www.byywee.com/page/M0/S868/868615.html 关于Model验证官方资料: http://msdn.microsoft.com/zh ...

  7. url中特殊符号转换

    特殊符号 url中显示 空格 %20 & %26

  8. <Google><APAC><kickstart><2017.05.07><2017RoundB>

    Google APAC kickstart 网址链接 我的所有solution代码和文件请点击 前言 这个比赛的题怎一个变态了得,虽然是第一次参赛,抱着熟悉流程的心态去的,但仍然被虐得一颤一颤的╮(╯ ...

  9. ArrayList方法综合练习

    package com.zs.windows; import java.util.ArrayList; import java.util.Scanner; import com.zs.entity.G ...

  10. Js代码一些要素

    ---恢复内容开始--- 条件语句 is(条件){ 语句 }else { 语句 } {}在js中我们把他叫代码块.如果代码块里内容没有执行完,语句就不会向下执行. 代码块是一个独立的整体.如果js中莫 ...