Centos7禁止或者允许开机启动服务
[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禁止或者允许开机启动服务的更多相关文章
- Centos7.x:开机启动服务的配置和管理
一.开机启动服务的配置 1.创建服务配置(权限754) vim /usr/lib/systemd/system/nginx.service 文件内容解释 [Unit]:服务的说明Description ...
- (转) CentOS 7添加开机启动服务/脚本
CentOS 7添加开机启动服务/脚本 原文:http://blog.csdn.net/wang123459/article/details/79063703 一.添加开机自启服务 在CentOS 7 ...
- Linux的运行级别和设置开机启动服务的方式
Linux的运行级别 什么是运行级别呢?简单点来说,运行级别就是操作系统当前正在运行的功能级别.级别是从0到6,具有不同的功能.这些级别定义在/ect/inittab文件中.这个文件是init程序寻找 ...
- centos 7 开机启动服务项优化
1. 使用 systemctl list-unit-files 可以查看启动项 systemctl list-unit-files | grep enable 过滤查看启动项如下 abrt-ccpp. ...
- centos7也支持service命令启动服务吗,对于centos7 中的systemctl和旧的service命令的区别和联系
一.centos7也支持service命令启动服务吗 CentOS 7.0中一个最主要的改变,就是切换到了systemd.它用于替代红帽企业版Linux前任版本中的SysV和Upstart,对系统和服 ...
- Hortonworks HDP Sandbox定制(配置)开机启动服务(组件)
定制Hortonworks HDP开机启动服务能够这样做:本文原文出处: http://blog.csdn.net/bluishglc/article/details/42109253 严禁不论什么形 ...
- centos7安装redis设置开机启动
1. 首先下载redis源码,并使用tar进行解压缩 wget http://download.redis.io/releases/redis-4.0.8.tar.gztar xvzf redis-4 ...
- linux chkconfig添加开机启动服务
--add:增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据: --del:删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的 ...
- linux自定义开机启动服务和chkconfig使用方法
linux自定义开机启动服务和chkconfig使用方法 1. 服务概述在linux操作系统下,经常需要创建一些服务,这些服务被做成shell脚本,这些服务需要在系统启动的时候自动启动,关闭的时候自动 ...
随机推荐
- Json使用示例
使用Json,可以下载如下所示的6个Jar包 整个工程目录结构如下: 简单的用法: package json; import net.sf.json.JSONArray; import net.sf. ...
- C语言转义字符'\'
body, table{font-family: 微软雅黑; font-size: 13.5pt} table{border-collapse: collapse; border: solid gra ...
- linux系统安装jdk详细配置
1.通过指令 whereis java 查看是否已经配置jdk 如果已经安装,通过指令 rm -rf <jdk路径> 删除 2.通过ssh工具将jdk-8u11-linux-x64.tar ...
- L230 RF可靠性测试-RF指标
最近调试Zigbee 和2.4G产品时需要做一些认证,查找到常用的RF指标. ----------http://www.52rd.com/S_TXT/2016_5/TXT83303.htm------ ...
- day 42 mysql 数据类型
mysql 数据类型 数据类型 truncate t1 (删除表) # 无符号类型 alter table t1 modify id tinyint unsigned (表里有值,不能直接改) d ...
- 框架:Spring IoC
Spring篇 第二章.Spring IoC简介 一.基本概念 控制反转是一个比较抽象的概念,是Spring框架的核心,用来消减计算机程序的耦合问题. 依赖注入是IoC的另外一种说法,只是从不同的角度 ...
- 在线播放Video/PDF/JPG
Label1.Text = Play(url, , ); public string Play(string url, int width, int height) { string strTmp = ...
- HDU 1808 Halloween treats(抽屉原理)
题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=1808 Problem Description Every year there is the same ...
- 对于maven的一些命令
- exe程序嵌入Winform窗体
1.新建winform程序,添加一个Panel控件和一个button控件,winform窗体命名为:Mainform: 2.新建一个类文件,方便引用,命名为:exetowinform: 3.Mainf ...