M01:
Introduction to Operating Systems
|
TU1: Installing, configuring
and exploiting a computer system
|
ASIX1
|
Practical Exercise 8:
Managing services. Basic power management.
|
14-02-23
|
Practical
Exercise 8: Managing services. Basic power
management.
GENERAL CONDITIONS
1- Deadline: 26-2-2023.
2- Send your report as a PDF file attached to an e-mail with the following
specifications:
a) E-mail
address:
cf(at)collados.org or jordi.binefa(at)fje.edu depending on who is your
teacher
b)
File Name:
b.1) ASIX1 (English): asix1_surname_name_m01tu01pr08.pdf
and asix1_surname_name_m01tu01pr08.odt
b2.) DAW1 (English): daw1_surname_name_m01tu01pr08.pdf and daw1_surname_name_m01tu01pr08.odt
c) Subject:
c.1) ASIX1 (Engish): asix1_surname_name_m01tu01pr08
c.2) DAW1 (English): daw1_surname_name_m01tu01pr08
3- Make this report individually.
4- Left, right, top and bottom margins: 2cm.
5- Character format: a) Font: Arial, b) Size:
10, c) Questions typeface: Bold, d) Answers typeface: Regular
1-
What is a server (or daemon)?
a) A server (or daemon)
is a process that provides services to other computer
programs, the clients, running in the same
computer or in other computers connected through the network.
b) A service provides some functionality to
clients such as access to files stored in a remote computer,
access to web pages, access to databases, send or receive mails,
run commands in remote computers, store files in remote
computers, print documents on local and remote printers and so
on.
c) The usual state of a server is
interruptible sleeping (S) because is a program that awaits a
request from a client program. When a request is received from
a client, the server program wakes up, fulfill the task
requested by the client (so it change to the R state) and goes
back to the interruptible sleeping state (S).
d) A server is a process that is run in
the background.That
means:
* A background process works independently
of the shell, leaving the terminal free for other work.
* A background process is not
attached to your keyboard and screen and it runs without user
intervention.
* Users are not aware of the fact that background processes run on
their systems altough these processes are extremely
important to the normal working of an operating system.
* Users (and root) do not interact
directly with a background process but a signal can be
sent to a background process by users (or root).
f) Usually a server is an orphan process or a
process started by init and therefore, a server parent
process is usually init.
g) The most of the times a server starts during
the system startup (or boot) process
and it is terminated during the system shutdown
process. If you want to start a server when the system is
running then you need special command to start the server in
the proper way. If you want to terminate a server when
the system is running then you need another special command
to terminate the server in the proper way.
h) A server runs in the user space memory area.
i) Servers are owned:
* Usually by the root user and
their default group is root.
* Sometimes, servers can be owned by
specials users called system users. System users
are not real people but they have a UID, a name. permissions
and so on.
j) Typical nice value for most servers
is 0 (normal priority)
k) Servers are processes so root (and sometime some
users) can:
* Send signals to servers with kill
or killall
* Change nice value with nice
or renice
* Show servers with the help of ps
or top
* Send signals, change nice values
or show server with MATE Monitor System.
k) Servers are processes so they
need:
* % CPU time
* % RAM memory
* Access to resources such as hard
drive, network, printer, files,.....
l)
Linux provides to the system administrator with a set of tools
(commands) to easily:
* Start a server in the proper way
* Send a signal to terminate a server.
* Send the signal SIGHUP to a server
* Configure Linux to start (or not) a
server during the boot process
m)
Information about a service shown by typical service
management commands:
* LOAD: Whether or not the
service configuration was loaded in memory (LOAD).
Typical values:
- loaded
(configuration accepted and stored in memory)
- masked
(prevents activation until unmasked
- not-found
- bad-setting
(configuration errors)
-
error (configuration errors)
* ACTIVE: It
shows the high-level service state.
Typicial values: active, reloading,
inactive, failed, activating,
deactivating
- active
--> Generally speaking, it
means that service has started
sucessfully
- inactive -->
Generally
speaking, it
means that
service
is stopped.
- failed
-->
Service was
not started
because it
failed in some
way.
* SUB
(short for
substates):
- It shows the
low-level
service state.
Different
set of typical
values
depending on
the
service.
- Typicial
values:
running, failed,
exited, dead,
listeninig,
plugged,mounted.....
- running
--> It
means that
there is
currently a
process
associated to
the service.
- failed
-->
Service was
not started
because it
failed in some
way.
- dead
--> Service
was stopped
and therefore,
the process
assciated to
the service
was terminated
- exited ->
Service
was started
and stopped.
Some service
are started,
provide a
service and
are stopped
Typical
combinations:
- loaded,
active,
running
-> The
services works
fine. The
server program
is running and
providing the
service.
- loaded,
inactive, dead
-> The
service was
stopped. The
server program
was terminated
and it is not
providing the
service.
-