CentOS7系列--1.4CentOS7服务

CentOS7服务管理1. 查看服务1.1. 查看所有运行的服务[root@centos7 ~]# systemctl -t serviceUNIT LOAD ACTIVE SUB DESCRIPTIONauditd.service loaded active running Security Auditing Servicecrond.service loaded active running Command Schedulerdbus.service loaded active running D-Bus System Message Busgetty@tty1.service loaded active running Getty on tty1irqbalance.service loaded active running irqbalance daemonkmod-static-nodes.service loaded active exited Create list of required statinetwork.service loaded active exited LSB: Bring up/down networkingNetworkManager-wait-online.service loaded active exited Network Manager Wait OnNetworkManager.service loaded active running Network Managerpolkit.service loaded active running Authorization Managerpostfix.service loaded active running Postfix Mail Transport Agentrhel-dmesg.service loaded active exited Dump dmesg to /var/log/dmesgrhel-import-state.service loaded active exited Import network configurationrhel-readonly.service loaded active exited Configure read-only root supprsyslog.service loaded active running System Logging Servicesshd.service loaded active running OpenSSH server daemontuned.service loaded active running Dynamic System Tuning Daemonvmtoolsd.service loaded active running Service for virtual machinesLOAD = Reflects whether the unit definition was properly loaded.ACTIVE = The high-level unit activation state, i.e. generalization of SUB.SUB = The low-level unit activation state, values depend on unit type.31 loaded units listed. Pass --all to see loaded but inactive units, too.To show all installed unit files use 'systemctl list-unit-files'.1.2. 查看所有服务[root@centos7 ~]# systemctl list-unit-files -t serviceUNIT FILE STATEarp-ethers.service disabledauditd.service enabledautovt@.service enabledblk-availability.service disabledbrandbot.service staticconsole-getty.service disabledconsole-shell.service disabledcontainer-getty@.service staticcpupower.service disabledcrond.service enableddbus-org.freedesktop.timedate1.service staticdbus.service staticdebug-shell.service disableddnsmasq.service disableddracut-cmdline.service staticdracut-initqueue.service static2. 关闭并禁止自动启动服务[root@centos7 ~]# systemctl stop postfix[root@centos7 ~]# systemctl disable postfixRemoved symlink /etc/systemd/system/multi-user.target.wants/postfix.service.[root@centos7 ~]#3. 还有一部分SysV服务被chkconfig管理[root@centos7 ~]# chkconfig --listNote: This output shows SysV services only and does not include nativesystemd services. SysV configuration data might be overridden by nativesystemd configuration.If you want to list systemd services use 'systemctl list-unit-files'.To see services enabled on particular target use'systemctl list-dependencies [target]'.netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:offnetwork 0:off 1:off 2:on 3:on 4:on 5:on 6:off[root@centos7 ~]# chkconfig netconsole off

相关内容推荐