New commands of the old task commands enable a service to automatically start chkconfig -- level3httpdonsystemct
| Task |
Old commands |
New command |
| Enable a service automatically |
Chkconfig -- level 3 httpd on |
Systemctl enable httpd. service |
| Disable automatic startup of a service |
Chkconfig -- level 3 httpd off |
Systemctl disable httpd. service |
| Check service status |
Service httpd status |
Systemctl status httpd. service (service details) Systemctl is-active httpd. service (only show whether it is Active) |
| Show all started Services |
Chkconfig -- list |
Systemctl list-units -- type = service |
| Start a service |
Service httpd start |
Systemctl start httpd. service |
| Stop a service |
Service httpd stop |
Systemctl stop httpd. service |
| Restart a service |
Service httpd restart |
Systemctl restart httpd. service |
Start the nginx service
systemctl start nginx.service
Set auto-start
systemctl enable nginx.service
Stop auto-start
systemctl disable nginx.service
View current service status
systemctl status nginx.service
Restart the service
systemctl restart nginx.service
View all started Services
systemctl list-units --type=service