7

I used to use service command for restarting, reloading, and checking status of service on centos 6.5 like below:

$ sudo service nginx restart OK
$ sudo service nginx status OK

But, in CentOS 7 I get this notice for doing the same thing.

[root@admin ~]# service nginx restart
Redirecting to /bin/systemctl restart  nginx.service
[root@admin ~]# 

Question: How do I start nginx service in Centos7.5?

7

service command doesn't work in CentOS 7 any more. Redhat based OS migrated to Systemd from SysVinit system.

You have to use systemctl start nginx.service

For sysVinit to systemd cheatsheet visit following link: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet

2
  • 1
    Weird. It does work with just systemctl start nginx but it never shows the status, or OK message. – robue-a7119895 Oct 9 '14 at 16:04
  • 1
    For RHEL 7, the systemctl command replaces service and chkconfig, however, you can still use the service and chkconfig commands to start/stop and enable/disable services, respectively. – geedoubleya Oct 10 '14 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.