banner



How To Start Stop A Service In Linux?

As with all other operating systems, Linux has services and other processes that run in the background to perform certain important functions while the organisation is running. When the arrangement is booted, the services get-go automatically and continue to run in the groundwork until the system is close down. However, you tin also offset, stop and restart the services manually.

In this article, I'll show you different methods for starting, stopping, and restarting services in Ubuntu. The article covers systemd, the service command, and init scripts. These commands work on all electric current versions of Ubuntu, including the new Ubuntu 22.04.

List all services in Ubuntu

Before we start, I will show y'all how to go a list of all the services on your computer as we demand to know the service name to manage the service.

service --condition-all

Information technology will bear witness a complete list of services on Ubuntu.

List services in Ubuntu

Employ Systemd to Start/Stop/Restart Services in Ubuntu

You can offset, stop or restart services using Systemd systemctl utility. This is the preferred way on current Ubuntu versions like Ubuntu 18.04, Ubuntu 20.04, and Ubuntu 22.04.

Open up upward a last window, and enter the following commands. For instance, in this case, I desire to get-go, stop or restart the UFW Firewall service in Ubuntu.

The Syntax is:

sudo systemctl [action] [service name]

To start a service:

sudo systemctl stop ufw

To stop a service:

sudo systemctl commencement ufw

To restart a service:

sudo systemctl restart ufw

To check the status of service:

sudo systemctl status ufw

Manage services with systemd

Start/Terminate/Restart Services with service command on Ubuntu

You lot can start, stop, or restart services using the service command as well. Open up a terminal window, and enter the following commands.

To start a service:

sudo service ufw finish

To stop a service:

sudo service ufw start

To cease a service:

sudo service ufw restart

To check the status of a service:

sudo service ufw status

Manage services with the service command on Ubuntu

Using Init scripts to manage services on Ubuntu

You can get-go, stop or restart services using init scripts in the /etc/init.d directory. This directory actually consists of various scripts for unlike services. Init scripts are deprecated since Ubuntu switched to Systemd, and then this method will be used only if you take to bargain with an old Ubuntu version. Open upwardly a terminal window, and enter the post-obit commands.

To commencement a service:

/etc/init.d/ufw beginning

To stop a service:

/etc/init.d/ufw stop

To stop a service:

/etc/init.d/ufw restart

To cheque the condition of service:

/etc/init.d/ufw status

Manage services by using init scripts

That is how you can outset, stop, and restart services using different ways without restarting the whole operating organisation. You can as well use these commands in other Linux distributions.

How To Start Stop A Service In Linux?,

Source: https://vitux.com/how-to-start-stop-or-restart-services-in-ubuntu/

Posted by: frazierbincepuld.blogspot.com

0 Response to "How To Start Stop A Service In Linux?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel