博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Centos7禁止或者允许开机启动服务
阅读量:6226 次
发布时间:2019-06-21

本文共 7326 字,大约阅读时间需要 24 分钟。

[root@bogon rsyslog.d]# systemctl is-enabled httpddisabled[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...ageJun 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...ageJun 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 -DFOREGROUNDJun 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...ageJun 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...ageJun 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...ageJun 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  httpdCreated 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  httpddisabled[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等。以后会补充进来

转载于:https://www.cnblogs.com/biaopei/p/7730547.html

你可能感兴趣的文章
Protostuff序列化
查看>>
Servlet & Jsp
查看>>
python Image模块基本语法
查看>>
DS博客作业01--日期抽象数据类型设计与实现
查看>>
docker镜像的操作
查看>>
Tomcat 9.0安装配置
查看>>
mybatis :实现mybatis分页
查看>>
hdu-2685 I won't tell you this is about number theory---gcd和快速幂的性质
查看>>
异常处理
查看>>
家庭记事本开发进度2
查看>>
[Azure] 使用 Visual Studio 2013 管理中国版 Azure 订阅
查看>>
VB动态添加WebBrowser控件,并拦截弹出窗口(不用引用任何组件)
查看>>
C#线程的参数传递
查看>>
HDU1059
查看>>
jquery 选择器多个
查看>>
关于Maya 的 Node ID
查看>>
[转]DPM2012系列之十一:还原exchange 2010数据库
查看>>
Vector、ArrayList、List使用深入剖析
查看>>
教孩子学编程 Python
查看>>
:s 命令来替换字符串
查看>>