How To Start, Stop and Get Status of Linux Service With Systemd?


Services are all over the Linux world. Enterprise Linux world turn over services. There are different tools to manage Linux services like Sys-V, upstart, systemd etc. Systemd is gaining popularity in recent times. Fedora, CentOs, RedHat uses systemd for a long time. Ubuntu started to use systemd too. Here we will look into basics of the service management with systemd.

List Installed Services

We want to see installed services so we will start the services with its exact name.

  • In systemd services are named unit so we use systemctl list-units command.
  • As we see there information about service status like active
LEARN MORE  How To Solve Cannot Start Container Bridge Not Found Problem In Docker?

Get Status of a Service

Now we can know exact names of the services. We want to get detailed information about httpd service.

  • systemctl status is the command to get status information
  • httpd is the service we want to see status information.
  • Active:active means it is running currently
  • At the bottom we can see latest logs generated by httpd service
LEARN MORE  How to use GPG(GnuPG)

Start Service

We can start httpd service easily like below

Stop Service

The easiest part of managing services is stopping them. We can stop them like start

Restart Service

After making configuration changes about services  we need to stop and start service. The practical way is just restarting service like below.

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)