banner



The Command To Stop A Service In Unix?

Services are of import groundwork processes on a organization. Generally, they are launched when you kick upward your system. If you are just a regular desktop user, knowing how to start, finish and restart services is essential for various day to day tasks. On the other hand, managing services is a common job for a Linux system admin. In this tutorial, nosotros volition hash out how to kickoff, stop and restart services on a Linux organisation.

Annotation: This tutorial was made with an Ubuntu 18.04 running system. Still, the same instructions will piece of work on Ubuntu xvi.04 and Debian based distributions like Elementary Bone, Linux Mint, and Debian.

Getting started

There are two common methods used when we discuss how to beginning, finish, and restart services on Linux. These two methods are systemd and init. Both init and systemd are daemon processes designed to manage services on a Linux system and are launched when the system is booted up. While init is an abridgement for 'initialization', systemd is a system direction daemon which has a 'd' at the end to follow the UNIX naming convention for daemons.

The systemd daemon provides us with the systemctl command to piece of work with system services. The name systemctl is an abbreviation for 'system control. The service command is used to

Using the service command

The service control is part of the init daemon. Information technology was used commonly in earlier distributions of Linux based systems to manage services on a system. Let us have a wait at how to commencement, cease and restart services using the service control.

1. Listing all the services

Before nosotros learn how to offset, stop and restart services on Linux using the service command, we need to know how to listing all the services using the init daemon. To practice so, nosotros use the following control.

Service Status
Service Status

Using this command in the command line volition give an output similar to the 1 seen below. Find that we go a listing of all the services on our organisation. In this list, services preceded by a [+] sign are enabled while the ones preceded by a [-] sign are disabled.

This command can be used to find out the current status of a service on our organization. Else, you can use it to verify that your point to the system to showtime, stop or restart a service took issue.

two. Starting a service

Now we will talk over how to kickoff a service. To exercise so, we use the outset choice of the service control. This option is preceded by the name of the service which we wish to get-go. We blazon the following command to stop a service on a Linux arrangement.

service <ServiceName> start                

3. Stopping a service

To stop a service using the service control, we utilise the stop option. This option is preceded past the name of the service which we wish to cease. Typing the following command volition end the specified service on your Linux system.

service <ServiceName> stop                

4. Restarting a service

To restart a service using the service command, we make use of the restart choice. Similar previous examples, this option is typed after the name of the service which we wish to offset. The following command helps us restart a service on Linux.

service <ServiceName> restart                

Using the systemctl control

The systemctl command is role of the systemd daemon. It is used usually in newer distributions of Linux based systems to manage services on a system. The systemd daemon was designed to supercede the init daemon by offering better service management efficiency. Permit us have a expect at how to starting time, stop and restart services using the systemctl command.

1. Listing all the services

Before nosotros have a look at how to offset, stop and restart services on Linux using the systemctl command, we need to know how to list all the services using the systemd daemon. To practise so, we type the following command in our last.

systemctl list-unit-files --blazon service -all                
Systemctl 1 1
Systemctl i 1

Using the systemctl command will requite an output similar to the ane seen beneath. Detect that nosotros get a list of all the services on our organisation. In this list, unlike the symbolic representation seen in instance of the services control, nosotros get a new column that holds the status of the services on our arrangement.

This command can be used to find out the electric current condition of a service on our system. Else, you tin use information technology to verify that your signal to the system to start, terminate or restart a service took effect.

two. Starting a service

To start a service using the systemctl command, we utilise the commencement option. This option is followed by the name of the service which we wish to first. Type the following command to kickoff a service on your Linux arrangement.

systemctl kickoff <ServiceName>                

3. Stopping a service

Now we volition discuss how to terminate a service. To do so, we use the stop pick of the systemctl command. This option is followed by the name of the service which we wish to start. Nosotros utilise the following control to cease a service on a Linux system.

systemctl stop <ServiceName>                

4. Restarting a service

To restart a service using the systemctl control, we utilise the reget-go selection. Similar previous examples, this selection is followed by the name of the service which nosotros wish to kickoff. The following command helps usa restart a service on Linux.

systemctl restart <ServiceName>                

Conclusion

All Linux users need to know how to start, terminate and restart services. This enables a person to have greater control over the services on their organisation. Knowing service management is also helpful while installing new utilities or programs like a server on your machine.

This is because new services often need to be manually started, while quondam services need to be restarted in example of configuration changes. We promise this tutorial was able to help you sympathize the procedure to start, end, and restart services on a Linux system. If you lot have any feedback, queries, or suggestions, feel free to reach out to the states in the comments below.

The Command To Stop A Service In Unix?,

Source: https://www.linuxfordevices.com/tutorials/linux/start-stop-restart-services-linux

Posted by: whitcombatuddrefould.blogspot.com

0 Response to "The Command To Stop A Service In Unix?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel