sudo /etc/init.d/apache2 restart
sudo service apache2 restart
What are the differences?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
service calls scripts located in
/etc/init.d, so there are no differences in the result in this case.
service runs a System V init script or upstart job in as predictable environment as possible, removing most environment variables and with current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT, or the name of an upstart job in /etc/init.