Service command in Ubuntu 8.10 (Intrepid) server

Sponsored Link
If you want to use service command in ubuntu intrepid install sysvinit-utils package.This package contains the important System-V-like utilities.Specifically, this package includes: killall5, last, lastb, mesg, pidof, service, sulogin.

If you have experience with Red Hat, Fedora, and CentOS servers you might be knowing about service command this is very useful command to start,stop and restart a service simple way.

Service Syntax

sudo service <service name> start/stop/restart

Service command Examples

For example if you want to restart apache server use the following command

sudo service apache2 restart

One more

sudo service named restart

If you want to show the status of all services on your ubuntu server use the following command

sudo service --status-all

This command is very useful for server administrators.

Sponsored Link

You may also like...

7 Responses

  1. Arky says:

    Ah! I see the good ol’ service command is finally in debian 😛

  2. Thomas says:

    AFAIK

    sudo /etc/init.d/ [start|stop|restart|status|???]

    does the same thing, and comes with tab-completion in case you forget the name of the service (or you’re too lazy to type it).

  3. Alex says:

    there is also “sudo invoke-rc.d start/stop/restart, also with tab completions

  4. Mark says:

    As Thomas has said /etc/init.d does the same thing…what is the point of using the service command, what benefits can it provide? Does it bypass the need for init.d scripts?

  5. Jason says:

    Does Ubuntu provide a GUI tool that does the same?

  6. Thomas says:

    System->Administration->Services can set the state of services (i.e. whether or not to start them).

    There’s no GUI tool I know of to bounce them (other than Konsole 🙂

  7. Patrick says:

    The service commands make things simpler imo. The service command offers tab completion as well. It saves keystrokes compared to the ‘traditional’ way but thats just my 2 cents.

Leave a Reply

Your email address will not be published. Required fields are marked *