• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Use Systemctl Command to Manage Systemd Services

Written by Rahul, Updated on December 30, 2017

This article will help you to how to manage services using the systemctl command for Systemd services. Systemd is a system and service manager for Linux-based operating systems for managing services. Systemd is more powerful and getting more popularity over older SysVinit. Most of newer release of the Linux-based operating system (eg: CentOS/Redhat 7, Fedora 25, Ubuntu 16.04) using Systemd as a default service management tool.

Before using the following example commands change <servicename> with your actual service name like httpd, mysql, apache2 or ssh.

Start or Stop Service:

Syntax:

$ sudo systemctl start <servicename>.service
$ sudo systemctl stop <servicename>.service
  • start: Used to start a stopped service
  • Stop: Used to stop a running service

Example:

$ sudo systemctl start ssh.service
$ sudo systemctl stop ssh.service

Restart or Reload Service:

$ sudo systemctl reload ssh.service
$ sudo systemctl restart ssh.service
$ sudo systemctl reload-or-restart ssh.service
  • Reload: Used to reload configuration of a running service
  • Restart: Used to restart (Stop/Start) a running service
  • reload-or-restart: Used to reload a service default, but if reload is not available for that service. It will restart it

Check Status of Service:

$ sudo systemctl status ssh.service
  • Status: Used to check current status of a service

Enable or Disable Service:

$ sudo systemctl enable ssh.service
$ sudo systemctl disable ssh.service
  • Enable: Used to enable service to start on system boot
  • Disable: Used to disable service to not to start on system boot

Check Enable/Disable Status of Service:

$ sudo systemctl is-active ssh.service
$ sudo systemctl is-enabled ssh.service
  • is-active: Used to check if service current service status
  • is-enabled: Used to check if service is enabled to start on system boot

Reference:
https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy