[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. 【转载二】Grafana系列教程–Grafana的下载及安装

    本篇教程,waitig 来为大家介绍一下Grafana的安装及运行的方式. 更多Grafana技术请加入<InfluxDB&Grafana技术交流群:580487672(点击加入)> ...

  2. 深入理解java虚拟机---JDK8-废弃永久代(PermGen)迎来元空间(Metaspace)(十二)

    引用:https://www.cnblogs.com/yulei126/p/6777323.html JDK8-废弃永久代(PermGen)迎来元空间(Metaspace)   1.背景 2.为什么废 ...

  3. Linux如何从零开始搭建rsync+serync服务器(centOS6)

    一.为什么要用Rsync+sersync架构? 1.sersync是基于Inotify开发的,类似于Inotify-tools的工具 2.sersync可以记录下被监听目录中发生变化的(包括增加.删除 ...

  4. Matlab中小语法点总结(更新中)

    1. A(:,1)'   A(:)'   A(:).' A(:,n)' 对矩阵A的低n列进行共轭转置:A(:).'对矩阵A进行转置: 2.subplot的使用方法: h =subplot(m,n,p) ...

  5. DevExpress v18.1新版亮点——Reporting篇(三)

    用户界面套包DevExpress v18.1日前终于正式发布,本站将以连载的形式为大家介绍各版本新增内容.本文将介绍了DevExpress Reporting v18.1 的新功能,快来下载试用新版本 ...

  6. Vue.js与WdatePicker日历控件冲突问题的解决方案

    问题:同时使用Vue.js与WdatePicker时,双向绑定的日期字段获取不到界面输入的值,而且别的字段的值改变后,日期控件的内容会被清空 原因:WdatePicker不是Vue的插件,不能响应Vu ...

  7. react state为数组时插入值

    react state为数组时,如何插入值.在react里,一切皆是状态state,如果想通过改变state修改渲染效果,只能yongsetState.但是setState又是key:value格式, ...

  8. ubuntu16.04系统安装

    0x1镜像下载 (1)下载地址http://cn.ubuntu.com/download/ 0x2 安装 (1)打开vmware,创建新的虚拟机 (2)选择自定义安装 (3)直接下一步,选择稍后安装系 ...

  9. C高级第二次PTA作业

    6-7 删除字符串中数字字符 1.设计思路: (1)算法: 第一步:定义一个字符数组item,输入一个字符串赋给字符数组item.调用函数delnum, 第二步:在函数delnum中定义循环变量i=0 ...

  10. php操作redis(转)

    Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API. Redis支持的数据类型有 Stirng(字符串), Lis ...