Managing Systemd in Linux

Managing Systemd in Linux

Systemd helps us to keep & managing the services in easy way or keep the services running or start on boot.

Here are the simple commands which will help you to manage systemd services.

Where systemd services are located?

Most of the systemd services are located in these locations.


How to view the status of systemd service

The running or stopped status of systemd service can be monitored by the following command.

systemctl status SERVICE Name


systemctl status umami

How to view the list of running and enabled systemd services

This command will show the list of enabled systemd services

systemctl list-unit-files | grep enabled

How to find the location of systemd service

systemctl show NAME.service | grep Path


systemctl show umami.service | grep Path

How to create systemd service

nano /lib/systemd/system/NAME.service

Replace NAME with your Preferred service name

and paste the below lines into the file

Description= Description of the Service
WorkingDirectory= PATH OF THE FOLDER

Here is the Example:

Save and close it. Press Ctrl + O to save. Press Ctrl + X to close

Then, Start and Enable

systemctl start NAME
systemctl enable NAME

That's it for this article.