Managing the Processes and Controlling the access.
Hello everyone!!
I am back with my new exciting blog from the blog series...
This is the sixth blog of the series regarding the Linux workshop organized by Pranav Jambare sir.
Contents:
Booting Process
Access Contol List
Processes
Booting Processes:
There are six states in the Booting process.
- BIOS:
BIOS stands for basic input /output System. In simple terms, the BIOS loads and executes the Master Boot Record (MBR) boot loader.
It performs a power-On-Self-Test to check if all hardware components are working correctly.
- MBR:
MBR stands for Master Boot Record.
MBR is a small section of the hard drive's first sector that contains essential boot information.
it includes the 446 bootloaders 64 partition table 2 magic, such as LILO and GRUB, which helps start the operating system during the booting process.
- GRUB :
GRUB stands for Grand Unified Bootloader.
GRUB 1 - we can get the code point to another level.
GRUB 1.5- Allow the file system to communicate with the hardware
GRUB 2- Responsible for loading of kernal.
- Kernal:
Kernal is the heart of the operating system, responsible for initializing and managing hardware, memory, and processes.
it uncompresses itself and mounts it.
it creates a root device and mounts it into the read-only memory.
it freezes the unused memory.
it is also responsible for initializing virtual devices into the system.
- Init.d/system d:
The first process of Linux is known as init.d.
it mounts the file system i.e./etc/fsab.
it identifies the default target.
it initializes the services.
- Run level:
it is a specific mode or state in which a computer's operating system starts up.
#syntax who -r #this command is used to display the current run level of linux system during the booting process
#syntax
systemctl set default multi-user.target
#this command is used to confugure the default run level.
#syntax
systemctl get-default
#this command is used to retrieve the default target.
Modes are:
0 - halt state/poweroff.target.
1 - Single user mode/rescue. target.
2 - Multiuser mode without networking.
3 - multiuser mode with networking.
4 - user definable.
5 - GUI graphical target.
6 - Reboot target.
ACL:
ACL stands for Acess Control List.
ACL provides access control to directories and files.
ACL can set read, write, and execute permissions for the owner, group, and all system users.
An ACL consists of a set of rules that specify how a specific user or group can access ACL-enabled files and directories.
ACL is used for controlling permissions to a computer system or computer network.
ACL can be set with the following command:
#syntax setfacl -m u:<username>:<permission> <directoryname> #example setfacl -m u:riya:rwx /tmp/testACL
The following command is used for viewing ACLs on a file or directory.
#syntax getfacl <filename/directoryname> #example getfacl sampleACL
To remove ACLs, we use the following command:
#syntax
setfacl -x u:<username>: <filename>
# example
setfacl -x u:testuser:rwx sampleACL
Processes:
Processes in Linux are essential components of the operating system that execute programs and manage system resources.
Each process operates independently, having its memory space, execution context, and system resources.
There are five states of process in Linux:
Created
Ready
Running
Waiting
Terminate
Types of the process:
Parent process: A parent process is a process that creates another process (called the child process). It typically initiates the child's process to perform a specific task or execute a particular program.
Child process: A child process is created by a parent process and inherits some of its attributes and resources.
Orphan process: An orphan process is a child process whose parent process has terminated before it did.
Zombie process: A zombie process is a terminated child process that has completed its task, but its exit status is still needed by its parent. Although it no longer executes, it remains in the process table until the parent retrieves its exit status.
Some process-related commands:
To kill the process:
#syntax
kill -9 <pid>
#Example
kill -9 3132
To resume the Process:
#syntax
kill -18 <pid>
#Example
kill -18 3132
To terminate the process:
#syntax
kill -15 <pid>
#Example
kill -15 3132
To suspend the process:
#syntax
kill -19 <pid>
#Example
kill -19 3132
To check stopped processes:
#syntatical example
jobs
#general output
[1] + Done pwd
To run the process in the background:
#syntax
bg %<job number>
#Example
bg %1
To show Running Process:
#syntax
top
Fields of top command:
PID - Process ID
USER - User who initiated a particular process
PR - Priority
NI - NIC value
VIRT - Virtual memory
RES - Reserved memory
SHR S - Shared memory
%CPU - CPU uses
%MEM - Memory uses
TIME + - total CPU time
COMMAND- command line(name+options)
To start a new process by assigning the priority:
#syntax mice <-nice value>
The nice value ranges from -20 to 19 where the -20 is highest priority and 19 is the lowest priority.
To change the priority of an already running process :
#syntax renice <-nice value> <pid>
Thank you for reading my blog.....
Subscribe to my newsletter
Read articles from Riya Deshmukh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by