What is the difference between
service apache2 restart
and
/etc/init.d/apache2 restart
So basically why is the service command recommended compared to directly invoking the appropriate command?
Join Stack Overflow to learn, share knowledge, and build your career.
What is the difference between
service apache2 restart
and
/etc/init.d/apache2 restart
So basically why is the service command recommended compared to directly invoking the appropriate command?
The service
command runs the init scripts in a predictable environment:
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to /.