Understanding Linux Services and Internals

 
E
i
g
h
t
h
 
L
e
c
t
u
r
e
L
i
n
u
x
 
i
n
t
e
r
n
a
l
s
 
a
n
d
 
s
e
r
v
i
c
e
s
 
Sabah Anwer Abdulkareem
University of Diyala, College
of Engineering,  Department
of Computer Engineering
 
O
p
e
r
a
t
i
n
g
 
S
y
s
t
e
m
 
Components
 
 Hardware Controllers: This subsystem is comprised of all the possible
physical devices in a Linux installation
 Linux kernel: The kernel abstracts and mediates access to the hardware
resources, including the CPU. A kernel is the core of the operating system
 O/S Services: These are services that are typically considered part of the
operating system (e.g. shell)
 User Applications: The set of applications in use on a particular Linux
system. (e.g. web-browser)
 
D
i
r
e
c
t
o
r
y
 
S
t
r
u
c
t
u
r
e
 
S
h
e
l
l
:
 
S
h
e
l
l
 
i
s
 
b
r
o
a
d
l
y
 
c
l
a
s
s
i
f
i
e
d
 
i
n
t
o
 
t
w
o
c
a
t
e
g
o
r
i
e
s
 
 
1- Command Line Shell
Texture Mode
Executes requested command
 
S
h
e
l
l
:
 
S
h
e
l
l
 
i
s
 
b
r
o
a
d
l
y
 
c
l
a
s
s
i
f
i
e
d
 
i
n
t
o
 
t
w
o
 
c
a
t
e
g
o
r
i
e
s
 
2- Graphical shell
Mouse
Keyboard
 
Linux Services
 
A service is a program that runs in the background outside the
interactive control of system users as they lack an interface. This in
order to provide even more security, because some of these services
are crucial for the operation of the operating system.
 
On the other hand, in systems like Unix or Linux, the services are also
known as daemons. Sometimes the name of these services or
daemons ends with the letter d. For example, sshd is the name of the
service that handles SSH.
 
s
o
m
e
 
o
f
 
t
h
e
 
L
i
n
u
x
 
s
e
r
v
i
c
e
s
 
a
r
e
:
 
httpd
mysql
postgresql
proftpd
bluetooth
apparmor
cups
And many more applications are managed through a service.
 
H
o
w
 
t
o
 
L
i
s
t
 
S
e
r
v
i
c
e
s
 
i
n
 
L
i
n
u
x
 
First, we have to connect to our server using SSH.
we need to be the root user to list service in Linux.
 
we can list all services in Linux. To do it, run the command:
sudo systemctl list-unit-files --type service –all
SU
 
W
h
e
n
 
t
h
e
 
c
o
m
m
a
n
d
 
i
s
 
r
u
n
,
 
w
e
 
w
i
l
l
 
s
e
e
 
a
l
l
 
t
h
e
s
e
r
v
i
c
e
s
 
t
h
a
t
 
a
r
e
 
o
n
 
t
h
e
 
s
y
s
t
e
m
.
 
H
o
w
e
v
e
r
,
 
w
e
 
w
i
l
l
h
a
v
e
 
a
 
d
e
f
i
n
e
d
 
s
t
a
t
u
s
.
 
Enabled
 services are currently running. They usually have no
problems.
Disabled
 services are not active but can be activated at any time
without a problem.
Masked
 services won’t run unless we take that property away from
them.
Static
 services will only be used in case another service or unit needs
it.
Finally, there are services 
generated
 through a SysV or LSB initscript
with systemd generator.
 
 
In case we want to know only the services that are active, we have to
use a command together with 
grep
, like so:
sudo systemctl | grep running
 
M
a
n
a
g
i
n
g
 
L
i
n
u
x
 
S
e
r
v
i
c
e
s
 
Note that each service represents software that works differently. we
will only show how to start, check the status of and stop services –
the basic controls
To start a service on Linux, we need to run the following command:
 
 
If the service is correctly configured, it will start.  if we want to stop it,
we will use the following command:
sudo systemctl start [service_name]
sudo systemctl start [service_name]
 
sudo systemctl stop [service_name]
 
 
to check the status of a service we can use:
 
It is also possible to have a service run while the operating system is
being loaded
 
Or remove it from the initial load:
 
sudo systemctl status [service_name]
sudo systemctl enable [service_name]
sudo systemctl disable [service_name]
 
 
we will use 
netstat
. To install it on Ubuntu, we just run:
 
   Then, we run the following command:
 
 
The output will give us all the required network information.
 
 
sudo apt install netstat-nat
sudo netstat -plnt
Slide Note
Embed
Share

Explore the components of a Linux system, including hardware controllers, the Linux kernel, operating system services, user applications, directory structure, shells, and essential Linux services. Learn how to list services in Linux by connecting via SSH and accessing them as a root user to manage crucial background programs crucial for system operation.


Uploaded on Jul 25, 2024 | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Eighth Lecture Eighth Lecture Linux internals and services Linux internals and services Sabah Anwer Abdulkareem University of Diyala, College of Engineering, Department of Computer Engineering

  2. Operating System Operating System

  3. Components Hardware Controllers: This subsystem is comprised of all the possible physical devices in a Linux installation Linux kernel: The kernel abstracts and mediates access to the hardware resources, including the CPU. A kernel is the core of the operating system O/S Services: These are services that are typically considered part of the operating system (e.g. shell) User Applications: The set of applications in use on a particular Linux system. (e.g. web-browser)

  4. Directory Structure Directory Structure

  5. Shell: Shell is broadly classified into two Shell: Shell is broadly classified into two categories categories 1- Command Line Shell Texture Mode Executes requested command

  6. Shell: Shell is broadly classified into two categories Shell: Shell is broadly classified into two categories 2- Graphical shell Mouse Keyboard

  7. Linux Services A service is a program that runs in the background outside the interactive control of system users as they lack an interface. This in order to provide even more security, because some of these services are crucial for the operation of the operating system. On the other hand, in systems like Unix or Linux, the services are also known as daemons. Sometimes the name of these services or daemons ends with the letter d. For example, sshd is the name of the service that handles SSH.

  8. some of the Linux services are: some of the Linux services are: httpd mysql postgresql proftpd bluetooth apparmor cups And many more applications are managed through a service.

  9. How to List Services in Linux How to List Services in Linux First, we have to connect to our server using SSH. we need to be the root user to list service in Linux. SU we can list all services in Linux. To do it, run the command: sudo systemctl list-unit-files --type service all

  10. When the command is run, we will see all the When the command is run, we will see all the services that are on the system. However, we will services that are on the system. However, we will have a defined status. have a defined status. Enabled services are currently running. They usually have no problems. Disabled services are not active but can be activated at any time without a problem. Masked services won t run unless we take that property away from them. Static services will only be used in case another service or unit needs it. Finally, there are services generated through a SysV or LSB initscript with systemd generator.

  11. In case we want to know only the services that are active, we have to use a command together with grep, like so: sudo systemctl | grep running

  12. sudo systemctl stop [service_name] Managing Linux Services Managing Linux Services Note that each service represents software that works differently. we will only show how to start, check the status of and stop services the basic controls To start a service on Linux, we need to run the following command: sudo systemctl start [service_name] If the service is correctly configured, it will start. if we want to stop it, we will use the following command: sudo systemctl start [service_name]

  13. to check the status of a service we can use: sudo systemctl status [service_name] It is also possible to have a service run while the operating system is being loaded sudo systemctl enable [service_name] Or remove it from the initial load: sudo systemctl disable [service_name]

  14. we will use netstat. To install it on Ubuntu, we just run: sudo apt install netstat-nat Then, we run the following command: sudo netstat -plnt The output will give us all the required network information.

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#