Module 12. Service Management
Module 12. Service Management
Module 12. Service Management
❖ Services are programs (called daemons) that once started run continuously in the background
and are ready for input or monitor changes in your computer and respond to them. For example
the Apache server has a daemon called httpd (the d is for daemon) that listens on port 80 on
your computer and when it receives a request for a page it sends the appropriate data back to
the client machine.
❖ Many services are required to run all the time however many can be safely turned off for both
security reasons as running unnecessary services opens more doors into your computer, but also
for performance reasons. It may not make much difference but your computer should boot
slightly faster with less services it has to start on boot.
❖ One of the techniques in every Linux administrator’s toolbox to improve security of a box is to
turn off unneeded services.
❖ service - This controls the starting and stopping of services during a session, these setting are
not saved. If you start Apache this way but it is not set to start on boot using the above method
then it will continue to run but on next boot will not start automatically.
❖ chkconfig - This controls which services are set to start on boot, by their nature these setting are
saved and are applied at next boot. Changing these settings will not start the service
immediately; it will just flag them to be started from the next boot.
#service <name of the service> status --- To check the status of the service
#service <name of the service> start --- To start the service
#service <name of the service > stop --- To stop a service
#service <name of the service> reload --- To reload the service
#service <name of the service> restart --- To restart the service
Highlights of systemd:
1. To list all the available services on the system, use the below command.
3. To list the active state of all loaded units, use the below command.
4. To list the active and inactive state of all loaded units, use the below command.
5. The below command will help you that whether the service will be started automatically or not.
6. You can filter the failed services using the systemctl command with below mentioned options.
7. To prevent the service from starting at the boot time, use systemctl disable command.
The same way, if you want to start the specific service at the system boot time, use systemctl enable
command.
To start/stop firewall