Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Back some versions ago, when I wanted to restart, stop, start a sevice i would do something similar to this:

sudo /etc/init.d/apache2 stop to stop the apache service sudo /etc/init.d/networking start to start the networking service

Etc...

But now it has changed. How can I start, stop, restart any service in the latest Ubuntu with the new way.

share|improve this question

1 Answer

up vote 7 down vote accepted

sudo /etc/init.d/SOMETHING stop still works for service that come with a legacy SystemV init script, for service using Upstart use sudo stop SOMETHING.

sudo service SOMETHING stop works for both so it's usually what you want.

Replace stop with start or restart if needed.

share|improve this answer
Can you expand in more detail the answer to include how to find out which services are SystemV, Dependend Init and which ones are Upstart. Or a way to know which is which. – Luis Alvarado Aug 13 '11 at 14:23
1  
For Upstart jobs there's a file /etc/init/JOBNAME.conf, SysV init scripts are in /etc/init.d/. For compatibility reasons some Upstart jobs have a SysV init script that just run the respective Upstart commands. – Florian Diesch Aug 14 '11 at 1:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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