Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
What’s the recommended way to enable / disable services?

Are there any other command to start stop restart service in ubuntu other than the below following.

  1. service --status-all
  2. service <service name> stop
  3. sudosysv-rc-conf
share|improve this question
    
which service do you wish to start/stop/restart? there is at least a way to do it in several services but I think you should be more specific on your needs. I don't think there is a way to start/stop/restart all the services at the same time. –  Geppettvs D'Constanzo Aug 23 '11 at 19:21
    
for example if i wanted to stop nginx,I would do something like this $service nginx stop; I wanted to know if there are any other alternative ways to stop and start a service. Any GUI based application that displays or shows us the unused services etc. –  user7044 Aug 23 '11 at 19:33
    
I edited my answer to include a GUI client called BUM. If you're interested in GUIs, you should edit your answer to take out "command." Generally when people are looking for a "command" they aren't interested in a GUI. –  Kris Harper Aug 23 '11 at 20:53
    
You may find interesting the answers in this question askubuntu.com/questions/19320/…. –  Geppettvs D'Constanzo Aug 23 '11 at 21:02
1  
@AndreaCorbellini Answers there, including its accepted answer, also include information about how to start and stop services. Furthermore, the topics are naturally very closely related--anyone who wants to enable and disable services will probably want to know how to start and stop them as well, and most people who want to know how to start and stop them will likely also want to know how to enable and disable them. So I'm not sure. –  Eliah Kagan Sep 11 '13 at 15:42
show 2 more comments

marked as duplicate by hhlp, Stephen Myall, belacqua, Marco Ceppi Nov 22 '12 at 21:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 16 down vote accepted

It depends largely on the service. The new and preferred way to stop start and restart services is through /etc/init.d. So, for example, to stop or start the Apache Webserver, you can run

/etc/init.d/apache2 stop

/etc/init.d/apache2 start

The same is true of many other services, but probably not all. You can use the utility sysv-rc-conf to see which services you have that use an init.d script and manage them that way as well. Run it with sudo sysv-rc-conf.

If you're looking for a GUI application, try Boot up Manager. Install with

apt-get install bum

and run from the UI or from a terminal with

sudo bum

Usage and documentation can be found here.

share|improve this answer
    
Thanks all for giving me good options/alternatives. –  user7044 Aug 24 '11 at 3:54
    
Small mistake: should be /etc/init.d/apache2 stop and /etc/init.d/apache2 start instead of /etc/init.d/stop apache2 and /etc/init.d/start apache2. –  Rafał Cieślak Aug 24 '11 at 12:57
    
Whoops, edited. Thanks. –  Kris Harper Aug 24 '11 at 13:03
    
Boot-up Manager (bum) is very nice to have an easy report of services on our system. –  Pisu Nov 15 '11 at 21:56
add comment

You can use the following commands:

service <servicename> stop

service <servicename> start

service <servicename> restart

Note service --status-all doesn't stop or start anything, it just returns a status (and there's some known bugs in it).

If you have upstart then you can use these:

stop <servicename>

start <servicename>

restart <servicename>
share|improve this answer
add comment

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