Download ArticleDownload Article

This How.com.vn teaches you how to force a currently running service to restart in Linux. You can do this with just a few simple commands regardless of your Linux type.

  1. How.com.vn English: Step 1 Open the command line.
    Most Linux distributions have a Menu option in the lower-left corner of the screen, inside of which you'll find an application called "Terminal"; this is what you'll open to bring up the command line.
    • Since Linux distributions vary in appearance from release to release, you may have to look for the "Terminal" or command line app inside of a folder in the Menu.
    • You may find the "Terminal" app on the desktop or in the toolbar at the bottom of the screen instead of in the Menu.
    • Some Linux distributions have a command line bar at the top or bottom of the screen.
  2. How.com.vn English: Step 2 Enter the command to show currently running services.
    Type ls /etc/init.d into Terminal and press Enter. This will bring up a list of currently running services and their corresponding command names.
    • If this command doesn't work, try ls /etc/rc.d/ instead.
    Advertisement
  3. How.com.vn English: Step 3 Find the command name of the service that you want to restart.
    You'll typically find the name of the service (e.g., "Apache") on the left side of the screen, while the command name (e.g., "httpd" or "apache2", depending on your Linux distribution) will appear on the right side.
  4. How.com.vn English: Step 4 Enter the restart command.
    Type sudo systemctl restart service into Terminal, making sure to replace the service part of the command with the command name of the service, and press Enter.
    • For example, to restart Apache on Ubuntu Linux, you would type sudo systemctl restart apache2 into Terminal.
  5. How.com.vn English: Step 5 Enter your password when prompted.
    Type in the password that you use for your superuser account, then press Enter. This should restart the process.
    • If the service doesn't restart after doing this, try typing in sudo systemctl stop service, pressing Enter, and then entering sudo systemctl start service.
  6. Advertisement

Community Q&A

Search
Add New Question
  • Question
    Is it true that SSHD doesn't mean solid state hybrid drive, it means Secure Shell Daemon?
    How.com.vn English: Community Answer
    Community Answer
    It means both, actually. If you're talking about hard drives and storage, SSHD is correct for solid state hybrid drive. If you're talking about Linux, the Secure Shell Daemon is also correct.
  • Question
    What if I need to restart an app, like Firefox browser or Terminal? What command would I use?
    How.com.vn English: Somone
    Somone
    Community Answer
    You can see info on it here.
  • Question
    Which service controls ssh?
    How.com.vn English: Community Answer
    Community Answer
    It is just ssh or open-ssh based on your distribution of Linux. Just try both.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      • You can use the "chkconfig" command to add and remove services in your system start-up.
      • To see a comprehensive list of all current services in all directories on your computer, enter ps -A into Terminal.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Don't stop services at random while trying this out. Some of the services listed are necessary to keep your system stable and running happily.
      Advertisement

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 498,977 times.
      How helpful is this?
      Co-authors: 25
      Updated: February 16, 2024
      Views: 498,977
      Categories: Linux
      Article SummaryX

      1. Open the command line
      2. Enter ls /etc/init.d or ls /etc/rc.d/
      3. Find the name of the service you want to restart.
      4. Enter sudo systemctl restart service where service is the service name.
      5. Enter your password.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 498,977 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement