what are the commands to view / stop & start a service in linux

Posted on 2011-10-11
Last Modified: 2012-05-12
Hi,  a service has stopped on a linux server and I wish to restart it.  Could someone let me know the commands to view, stop and restart and particular service in linux
Question by:Arsenal01
    LVL 16

    Accepted Solution

    /etc/init.d/servicename status

    for example apache :

    /etc/init.d/httpd restart

    /etc/init.d/httpd status
    LVL 16

    Expert Comment

    /etc/init.d/servicename {start|stop|status|restart}

    Author Closing Comment

    Got it!! Thank you very much for your quick reply!!
    LVL 48

    Expert Comment

    Depending on your Linux distro, you can just do

    service apache status
    service apache restart


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now