How To Start And Stop Services In Linux
As with all other operating systems, Linux has services and other processes that run in the groundwork to perform certain of import functions while the system is running. When the arrangement is booted, the services start automatically and continue to run in the background until the organisation is shut downwardly. Still, you can also start, terminate and restart the services manually.
In this article, I'll bear witness you unlike methods for starting, stopping, and restarting services in Ubuntu. The article covers systemd, the service command, and init scripts. These commands work on all current versions of Ubuntu, including the new Ubuntu 22.04.
List all services in Ubuntu
Before we get-go, I volition show y'all how to go a list of all the services on your computer as nosotros demand to know the service proper noun to manage the service.
service --status-all
It volition show a complete list of services on Ubuntu.
Apply Systemd to Start/Cease/Restart Services in Ubuntu
You can showtime, stop or restart services using Systemd systemctl utility. This is the preferred style on current Ubuntu versions like Ubuntu eighteen.04, Ubuntu 20.04, and Ubuntu 22.04.
Open up a concluding window, and enter the following commands. For instance, in this case, I desire to beginning, terminate or restart the UFW Firewall service in Ubuntu.
The Syntax is:
sudo systemctl [activity] [service name]
To start a service:
sudo systemctl stop ufw
To cease a service:
sudo systemctl start ufw
To restart a service:
sudo systemctl restart ufw
To check the status of service: Advertizing
sudo systemctl status ufw
Showtime/Stop/Restart Services with service command on Ubuntu
You tin can start, cease, or restart services using the service command too. Open upwardly a final window, and enter the following commands.
To commencement a service:
sudo service ufw stop
To terminate a service:
sudo service ufw start
To stop a service:
sudo service ufw restart
To cheque the condition of a service:
sudo service ufw status
Using Init scripts to manage services on Ubuntu
Yous tin 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, then this method will exist used only if you have to bargain with an erstwhile Ubuntu version. Open up a final window, and enter the following commands.
To start a service:
/etc/init.d/ufw start
To stop a service:
/etc/init.d/ufw cease
To end a service:
/etc/init.d/ufw restart
To check the condition of service:
/etc/init.d/ufw condition
That is how you can get-go, finish, and restart services using different ways without restarting the whole operating system. You tin as well apply these commands in other Linux distributions.
How To Start And Stop Services In Linux,
Source: https://vitux.com/how-to-start-stop-or-restart-services-in-ubuntu/
Posted by: downeyelithe.blogspot.com
0 Response to "How To Start And Stop Services In Linux"
Post a Comment