Linux systemctl is the replacement for service and chkconfig

1.Enable a service to start automatically

1) chkconfig --level 3 SERVICENAME on (old command)    
2) systemctl enable SERVICENAME.service (new command)

2.Disable a service to start automatically

1) chkconfig --level 3 SERVICENAME off (old command)    
2) systemctl disable SERVICENAME.service (new command)

3.View service status(old command and old command)

1) service SERVICENAME status              
2) systemctl status SERVICENAME.service (Service details)
   systemctl is-active SERVICENAME.service (Show only if Active)

4.Add custom service

1) chkconfig --add SERVICENAME (old command)           
2) systemctl load SERVICENAME.service (new command)

5.Delete service

1) chkconfig --del SERVICENAME (old)           
2) Stop application,Delete the appropriate configuration (new)

6.Show all started services

1) chkconfig --list (old command)                   
2) systemctl list-units --type=service (new command)

7.Start a service

1) service SERVICENAME start (old command)       
2) systemctl start SERVICENAME.service (new command)

8.Stop a service

1) service SERVICENAME stop          
2) systemctl stop SERVICENAME.service

9.Restart a service

1) service SERVICENAME restart (old command)       
2) systemctl restart SERVICENAME.service (new command)

Pingbacks are closed.

Comments are closed.