service command depreciated in RHEL based OSs

service

The service command is no longer valid in red hat based systems such as CentOS and Scientific Linux. You will probably see the message “Redirecting to /bin/systemctl” when you try and start / stop / status a service. So now we have to do it as below:

For example:

service httpd start

Would now be run as below:

systemctl start httpd

 

chkconfig

chkconfig has also been changed, for example:

chkconfig httpd on

becomes

systemctl enable httpd

… and …

chkconfig httpd off

becomes

systemctl disable httpd

… and …

chkconfig httpd

becomes

systemctl is-enabled httpd

… and …

The below command shows what services are enabled (chkconfig –list):

systemctl list-unit-files --type=service

 

Hope this helps someone!

 

Leave a Reply

Your email address will not be published. Required fields are marked *