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

You Might Also Like

Change the Root Password in Linux Change Your Root Linux Password (Even If You Don't Know It)
Open Windows Services Open Windows Services: The Complete Guide
Run a Program from the Command Line on LinuxRun a Program from the Command Line on Linux
Execute a Script at Startup on the Raspberry PiExecute a Script at Startup on the Raspberry Pi
Become Root in Linux Access and Use the Root Account in Linux
Restart IIS in Windows Server 20164 Ways to Restart Your IIS Server in Windows 2016
Change Hostname on Linux Change the Hostname on Linux Without Rebooting
Reset Forgotten Password in LinuxReset Forgotten Password in Linux
Restart a Mac6 Ways to Restart Your Mac: Apple Menu, Shortcuts, and More
Become Root in Ubuntu Get Root Access in Ubuntu Linux
Assign an IP Address on a Linux ComputerAssign an IP Address on a Linux Computer
Linux How to Change UserLinux: How to Change User in Terminal & GNOME
Restart Terminal ServicesRestart Terminal Services
Remotely Shutdown a Computer Shut Down a Computer Remotely with Windows, Linux, & Mac
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 513,696 times.
How helpful is this?
Co-authors: 25
Updated: August 28, 2024
Views: 513,696
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 513,696 times.

Is this article up to date?

Advertisement