October 30, 2008 · Server · Email This Post

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

Incoming search terms:

Related posts

7 Comments to “Service command in Ubuntu 8.10 (Intrepid) server”

  1. Arky says:

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

    [Reply]

  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).

    [Reply]

  3. Alex says:

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

    [Reply]

  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?

    [Reply]

  5. Jason says:

    Does Ubuntu provide a GUI tool that does the same?

    [Reply]

  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 :-)

    [Reply]

  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.

    [Reply]

Leave a Reply