1. Control Service (services and Daemons)
RHEL7 Previous version Control services use service XX Start|stop|status:
[[Email protected] ~]# service sshd status
The RHEL7 Control service uses SYSTEMCTL Start|stop|status|restart XX service to view the current running status of the service using is-active:
[Email protected] ~]# systemctl status sshd
[Email protected] ~]# Systemctl is-active sshdactive
[Email protected] ~]# Systemctl sart|stop|restart sshd
See if a service will boot automatically start using is-enable, which corresponds to disable:
[Email protected] ~]# Systemctl is-enabled sshdenabled
Disable a service using mask, which corresponds to unmask:
The following summarizes the options for the SYSTEMCTL Command common Control Service:
start [name ...] start (Activate) one or more units start service stop [name ...] stop (deactivate) one or more units stop service reload [name ...] Reload one or more units Reload restart [name ...] Start or restart one or more units Restart kill [name ...] Send signal to processes of a unit Kill Process is-active [name ...] check whether units are active whether to start is-failed [name ...] check whether units Whether are failed fails status [name...| PID ...] show runtime status of one or more units status
enable [name ...] Enable one or more unit files boot disable [name ...] disable one or more unit files boot does not start reenable [name ...] reenable one or more unit files Reset Boot
is-enabled [NAME ...] Check whether unit files is enabled to boot mask [NAME ...] Mask One or more units disable service unmask [NAME ...] Unmask One or more units service
View all services for the system: Systemctl List-units-all or System ctl list-units-files:
[Email protected] ~]# Systemctl list-units
[Email protected] ~]# Systemctl list-unit-files
Add the type option to view all services:
[Email protected] ~]# systemctl list-unit-files--type serviceunit FILE State ABRT-CC Pp.service enabled Abrt-oops.service enabled Abrt-pstoreoops.service Disabled
This article is from the "Ordinary Road" blog, please be sure to keep this source http://linjohn.blog.51cto.com/1026193/1599225
RHCE7 Learning Notes 6--control services and background processes