HomeLinuxFind out how to use systemctl in Ubuntu?

Find out how to use systemctl in Ubuntu?


The “systemctl” refers to a command line utility whose principal goal is to make use of and handle the “systemd” initialization companies. It comes with a group of daemons, utilities, and libraries which can be useful for managing companies. The “systemd” system supervisor controls the system companies (24/7) and manages settings within the type of configuration information.

This publish pens down the usage of the “systemctl” command in Ubuntu 22.04 with the next tips:

Find out how to Use systemctl in Ubuntu?

The working of the “systemctl” command depends on its syntax.

Syntax:
The generalized syntax of the “systemctl” command is written right here:

$ systemctl [Options…] [Command NAME…]

The above syntax accommodates the next parameters:

  • systemctl: Represents the principle “systemctl” command.
  • Choices: Helps to get the specified output.
  • Command Identify: Specifies the service instructions.

Let’s see the sensible implementation of the above syntax for controlling “systemd” companies.

Systemctl Allow Companies

The “allow” service software is used as a command with the “systemctl” to allow the actual service in Ubuntu:

Observe: The “systemctl” command wants the superuser privileges, i.e., “sudo” to cope with the system companies.

$ sudo systemctl allow cron.service

The “cron” service has been enabled now completely.

Systemctl Disable Companies

To disable, use the “systemctl” command with the “disable” possibility as seen beneath:

The output reveals that the “cron” service has been disabled completely and can by no means allow after the boot.

Systemctl Begin Companies

The service command “begin” alongside the “systemctl” begins the companies briefly. It’s going to return into the earlier standing after booting up:

$ sudo systemctl begin apache2.service

The “apache2” service has been began and is able to use.

Systemctl Cease Companies

Use the “cease” with the “systemctl” software to cease the desired service for a brief interval of time (briefly):

$ sudo systemctl cease apache2.service

Systemctl Present Companies Standing

For checking the present working standing and particulars of the companies, execute the “systemctl” command mixed with the “standing/present” service utility:

$ sudo systemctl standing apache2.service

The “apache2” service is enabled however stopped briefly.

Systemctl Energetic Models Listing

The “systemd” makes use of the “models” which usually handle and management the duty/motion. Execute the “systemctl” command adopted by the “list-units” service command and the “kind” flag on this means:

$ systemctl list-units –type=service

Systemctl Particular Models State

As a substitute of all energetic models checklist the consumer also can checklist down the desired state of the models utilizing the “state” flag of the “systemctl” command:

$ systemctl list-units –type=service –state=exited

The energetic “systemd” models having current standing have been displayed within the terminal.

Conclusion

In Ubuntu, the “systemctl” command is used to regulate and handle the “systemd” companies with a mix of service instructions. The service command consists of “begin”, “cease”, “allow”, “disable”, and “standing” to handle, change, and verify the standing of the “systemd” companies. This information has enlisted a quick element of the target and utilization of the “systemctl” command.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments