Understand how to Manage Process and Monitor Services

Check out more papers on Computer

Introduction

On Linux based server or VPS or any Linux machine managing the services is the essential task to keep your server running and working fine. There are lots of services are running on the server at the same time such as HTTP service or PHP service or SSH service or crontab service or any third party services. Sometime this services may create problems an in a result it may create trouble to the server to avoid this circumstance we need to understand how to manage and handle and monitor these services, managing services is not a difficult task, so in this blog, we are going to see what is services and commands to manage services.

In Linux, service or daemons is an application that’s run in a background, waiting to be used or to be carrying out essential tasks. Controlling Services with systemctl System startup and server processes are managed by the systemd System and Service manager. This program provides a method for activating system resources, server daemons, and Other processes, both at boot time and on a running system. Daemons are processes that wait or run in the background while performing various tasks. To listen for connections, a daemon uses a socket Sockets may be created by daemons or may be separated from the daemon and be created by another process, such as systemd, which then passes the socket to the daemon when a connection is established by a client.

There are mainly two types of services one is self-service and another one is xinetd service

Self-service: The self-services mean the services which are initiated by the system itself most of the time these services are managed by systemd service manager. This kind of services is coming under essential services because if they didn’t run continuously it may affect the server or machines behavior. The services such as HTTP, DNS, Cronjob, etc.

Xinetd service: Xinetd services mean Extended Internet Services Daemon this is exactly the opposite of self-service this are not come under very essential services. This type of service we can run as per requirements, so because of that system utilized fewer resources and keep memory and CPU free for other processes or services. For example FTP, TELNET, SSH, SMTP, etc. services.

Before we start as we already seen the type of services. We also need to know where these services are get stored. Like in windows your all program file drivers related application files are get stored inside C: drive, exactly in the same way the services in Linux are getting executed from /usr/lib/system/system path and if you want to see all services and their port listed in the operating system you can go to /etc/services path. Now let see commands and there use to manage the services one by one.

  • 1. # systemctl status ---To check the live status of service (e.g # systemctl status crond) ---Here crond is name of crontab daemon.
  • 2. # systemctl stop ---To stop the running service.
  • 3. # systemctl start ---To start the service.

Once you start the service in the Active section it will show you the status of service as well as date and time when service gets started. Highlighted in red box.

  • 4. # systemctl restart ---To restart the service.
  • 5. # systemctl reload ---To refresh the service.
  • 6. # systemctl disable ---To permanently disable the service from boot time.

After disabling the service it will still show disabled in the service section. So now if it is self-service it will not start at the time of booting it need to start manually.

Let see some aspects regarding the Loaded and Active option.

  • 7. # systemctl enable ---To permanent enable the service from boot time.

Now if it is self-service it will start running when the system will boot.

  • 8. # systemctl mask --- To lock the service, it will prevent performing certain tasks regarding service such as start, restart, reload, enable, etc.

If you notice or compare the previous image in a Loaded section it shows you the path of the running service with status. Once you mask the service it will not show you any of that.

  • 9. # systemctl unmask ---It unlocks the service, it will remove the restriction of performing certain tasks regarding service such as start, restart, reload, enable, etc. after unmask it shows you all the details in Loaded section.
  • 10. # systemctl -- type = services ---it will show you all active services with their status and description.
  • 11. # systemctl --failed ---It will show you all failed services.
  • 12. # systemctl --type =services --all ---it will show you all active and deactivated services.
  • 13. # systemctl -H status

---by using this command you can control the services of hosts or another machine. Here -H is defined as host. (e.g. # systemctl -H root@192.168.0.101 status crond )

Conclusion:

By using the above command you can able to manage the services running on the server or any Linux machine. These commands may not work on every Linux operating system because systemctl command is introduced from RHEL 7 and CentOS 7. For an older version, you can use the command as follow.

Did you like this example?

Cite this page

Understand How to Manage Process and Monitor Services. (2021, Dec 29). Retrieved April 26, 2024 , from
https://studydriver.com/understand-how-to-manage-process-and-monitor-services/

Save time with Studydriver!

Get in touch with our top writers for a non-plagiarized essays written to satisfy your needs

Get custom essay

Stuck on ideas? Struggling with a concept?

A professional writer will make a clear, mistake-free paper for you!

Get help with your assignment
Leave your email and we will send a sample to you.
Stop wasting your time searching for samples!
You can find a skilled professional who can write any paper for you.
Get unique paper

Hi!
I'm Amy :)

I can help you save hours on your homework. Let's start by finding a writer.

Find Writer