PDF download Download Article PDF download Download Article

This wikiHow 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.

How to Restart a Service on Linux

  • Click the Terminal application in the menu to open a command line.
  • Type sudo systemctl restart service , where service is replaced by the command name of the service you want to restart.
  • Press Enter .
  1. 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. 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. 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. 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. 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?
    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?
    Somone
    Community Answer
    You can see info on it here .
  • Question
    Which service controls ssh?
    Community Answer
    It is just ssh or open-ssh based on your distribution of Linux. Just try both.
Ask a Question
      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
      Name
      Please provide your name and last initial
      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

      Article Summary X

      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 510,342 times.

      Is this article up to date?

      Advertisement