Difference between commands for starting,restarting, stoppping or reloading a service

Hello guys

I would like to know the difference between the following commands:

$ sudo service service_name  start|restart|stop|reload*

and

$ sudo /etc/init.d/service_name  start|restart|stop|reload*

For example,

$ sudo service  apache2  restart*

and

$ sudo /etc/init.d/apache2  restart*

If there are other commands that can work in the same way, you can let me know.

There is no such difference between those commands, all of them do the same job using the same files in here /etc/init.d/*

AFAIK there are no more commands to do the same job except if you are using cPanel/WHM, in that case you can use something like this:

/scripts/restartsrv_httpd, /scripts/restartsrv_cpanel, and so on....

1 Like

@modserv Thanks so much…

1 Like

No worries, you are most welcome :smile: