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.

Steps

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

  • Question
    Is it true that SSHD doesn't mean solid state hybrid drive, it means Secure Shell Daemon?
    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?
    Somone
    Somone
    Community Answer
    You can see info on it here.
  • Question
    Which service controls ssh?
    Community Answer
    Community Answer
    It is just ssh or open-ssh based on your distribution of Linux. Just try both.
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.
    ⧼thumbs_response⧽
Advertisement

About This Article

Jack Lloyd
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for wikiHow. 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 457,092 times.
How helpful is this?
Co-authors: 24
Updated: October 4, 2021
Views: 457,092
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?
Advertisement