Open In App

How to Control Systemd Services on Remote Linux Server

Last Updated : 02 Jan, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Linux, SysV, and LSB init scripts are compatible with Systemd, a system and service manager. Aggressive parallelization capabilities are offered by Systemd, which also offers on-demand daemon starting and uses Linux cgroups to keep track of processes. Systemd also supports system snapshotting and restore, maintains mount and automount points, and implements a complex transactional dependency-based service control logic. The primary tool for managing systemd is the systemctl command. It combines the capabilities of the chkconfig and service commands from SysVinit into a single device that you can use to activate and stop services either permanently or only for the current session. So-called units, which are graphical representations of system resources and services, are managed by systemd.c.

Control Systemd Services on Remote Linux Server

Follow the below steps to Control Systemd Services on Remote Linux Server:

Step 1: Run systemctl with the –host or -H flag as shown below to establish a connection to a distant server.

On the remote machine, create the systemd-manager user.

$ sudo useradd –create-home –systmd manager

Creating User

 

Step 2: The directory and file containing the public keys for authentication should be prepared.

$ sudo mkdir /home/systemd-manager/.ssh

Creating Directory

 

 

Step 3: Configure the authorization framework

$ sudo apt install policykit-1

Installaing policykit-1

 

Step 4: Remotely manage systemd services

$ systemctl –host systemd-manager@server.example.org status nginx

Remotely managing systemd services

 

Step 5: Give the go-ahead for more operations.

For a host, systemd-manager run the below command:

$ systemctl –host systemd-manager@server.example.org daemon-reload

More operations

 

Step 6: The session can be ended by typing [Ctrl+C].

$ man systemctl 

Ending session

 

Conclusion:

For Linux operating systems, systemd is a software package that offers a variety of system components. Its principal component is a “system and service manager,” an init system that is used to boot up user space and oversee user activities. Its main goal is to standardize service configuration and behavior across Linux distributions.


Previous Article
Next Article

Similar Reads

three90RightbarBannerImg
  翻译: