A service is an application (or set of applications) that runs in the background waiting to be used, or carrying out essential tasks. They are not interactive. It is detached from the keyboard and display of any interactive user. Process is a running program. At a particular instant of time, it can be either running, sleeping, or waiting for it’s parent process. A process is one or more threads of execution together with their shared set of resources.
To get list all the services on your computer, execute below command on terminal
A service can be started using
systemctl utility. Syntax of the command is
systemctl [action] [service name]
To start a service, open up a terminal window, and enter the following commands.
sudo systemctl start ufw
Above command will start a service ufw (firewall service in Ubuntu). Below example illustrate how to stop and restart the a service.
sudo systemctl stop ufw sudo systemctl restart ufw
To check the status of service, execute below command
sudo systemctl status ufw
A service can also start, stop, or restart using the
service command too. For example
sudo service ufw stop sudo service ufw start sudo service ufw restart sudo service ufw status
A service can also be managed using init scripts in the /etc/init.d directory. This directory consists of various scripts for different services. To work with these scripts, open up a terminal window and enter the following commands to start a service:
Similarly for other options use below example
/etc/init.d/ufw stop /etc/init.d/ufw restart /etc/init.d/ufw status