#Linux Series : P1 : Common cmds for all the services
Mustapha JDAD
Solutions Architect / Tech Lead ??Cloud/AWS ??On-promise ??Diverse Background ??Tech Mentor ??Continuous Learning & Improvement
service_name can be any service : httpd,ntpd,sshd....
# systemctl status service_name >> Check service status (Start/stop & enable/disable)
# systemctl |grep service_name >> Check service status (Start/stop & enable/disable)
# systemctl status service_name -l >> Check service status with more details.
# systemctl mask service_name >> To prevent any kind of activation, even manual.
# systemctl unmask service_name >> Unmask the unit files of the service
# systemctl restart service_name >> stop and start the service sequentially .
# systemctl start service_name >> start a specified unit, in other words, launch the concerned process
# systemctl stop service_name >> stop a specified unit, in other words, kill the concerned process
# systemctl reload service_name >> Taking into consideration the new configuration without restarting the service.
# systemctl enable service_name >> To configure a service to start when the system boots.
# systemctl disable service_name >> To prevent the service from starting at boot .
# systemctl is-active service_name >> Check if the service in active state.
# systemctl is-enabled service_name >> Check if the service in enable state.
# systemctl is-failed service_name >> Check if the service in failed state.
# systemctl show service_name >> Show service properties (PID,Start Time.....)
# systemctl list-units --type=service >> List all services no matter what the state is.
# systemctl list-units --type=service --state=active >> List all the ACTIVE services.
# systemctl list-units --type=service|grep active >> List all the ACTIVE services.
# systemctl --full --type service --all >> List all services no matter what the state is.
# systemctl --type=service >> List all services no matter what the state is.
# systemctl --failed --all >> List all the failed services.
# systemctl list-unit-files | grep enabled >> List enabled services.
# systemctl list-unit-files | grep disabled >> List disabled services.
The next chapter will cover :
P2: User and Group Administration
The Main Goal is To Make it easy for Others!