Processes, Access control, and Booting Process


Day-6. Hello Everyone, I am om kadam and welcome back to my channel. In this blog, we see processes, access control, and booting process.
1)Processes:- 1)Whenever a command is issued in Unix/Linux, it creates/starts a new process. For example, pwd when issued which is used to list the current directory location the user is in, a process starts.
2)Through a 5-digit ID number Unix/Linux keeps an account of the processes, this number is called process ID or PID. Each process in the system has a unique PID.
3)Used-up IDs can be used again for a newer process since all the possible combinations are used.
4)At any point in time, no two processes with the same pid exist in the system because it is the pid that Unix uses to track each process.
Process command:-
Nice command:-
#Syntax for nice
$ nice -n <niceNumber> <command>
PS Command:-
#displays a list of the processes that are currently runnung along with pid and other information
$ ps -ef|grep top
5 states of Processes:-
1)Created
2)Ready
3)Running
4)Waiting
5)Terminate
2) Access control:- Access control list (ACL) provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disc resource.
Use of Access Control List:-
1)Think of a scenario in which a particular user is not a member of a group created by you but still, wants to give some read or write access, how can you do it without making the user a member of the group, here comes in picture Access Control Lists, ACL helps us to do this trick.
2)ACLs are used to make a flexible permission mechanism in Linux.
3)From Linux man pages, ACLs are used to define more fine-grained discretionary access rights for files and directories.
Syntax:-
#General Syntax
setfacl <options>:<username>:<permissions> <directory name>
#To add permission for user
setfacl -m u:<user>:<permissions> <directory name>
#To add permissions for a group
setfacl -m g:<group>:<permissions> <directory name>
#To allow all files or directories to inherit ACL entries from the directory it is within
setfacl -dm <entry> </path/to/dir>
3)Booting Process:-
1. BIOS
1)BIOS stands for Basic Input/Output System. In simple terms, the BIOS loads and executes the Master Boot Record (MBR) boot loader.
2)When you first turn on your computer, the BIOS first performs some integrity checks of the HDD or SSD.
3)Then, the BIOS searches for, loads, and executes the boot loader program, which can be found in the Master Boot Record (MBR). The MBR is sometimes on a USB stick or CD-ROM such as with a live installation of Linux.
4)Once the boot loader program is detected, it's then loaded into memory and the BIOS gives control of the system to it.
2. MBR
1)MBR stands for Master Boot Record and is responsible for loading and executing the GRUB boot loader.
2)The MBR is located in the 1st sector of the bootable disk, which is typically /dev/hda
, or /dev/sda
, depending on your hardware. The MBR also contains information about GRUB or LILO in very old systems.
3. GRUB
1)Sometimes called GNU GRUB, which is short for GNU GRand Unified Bootloader, is the typical boot loader for most modern Linux systems.
2)The GRUB splash screen is often the first thing you see when you boot your computer. It has a simple menu where you can select some options.
3)If you have multiple kernel images installed, you can use your keyboard to select the one you want your system to boot with. By default, the latest kernel image is selected.
4)The splash screen will wait a few seconds for you to select an option. If you don't, it will load the default kernel image.
5)In many systems you can find the GRUB configuration file at /boot/grub/grub.conf
or /etc/grub.conf
. Here's an example of a simple grub.conf
file:
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5PAE)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/
initrd /boot/initrd-2.6.18-194.el5PAE.img
4. Runlevel programs
1)Depending on which Linux distribution you have installed, you may be able to see different services getting started. For example, you might catch starting sendmail …. OK
.
2)These are known as run-level programs and are executed from different directories depending on your run level. Each of the 6 run levels described above has its own directory:
Run level 0 –
/etc/rc0.d/
Run level 1 –
/etc/rc1.d/
Run level 2 –
/etc/rc2.d/
Run level 3 –
/etc/rc3.d/
Run level 4 –
/etc/rc4.d/
Run level 5 –
/etc/rc5.d/
Run level 6 –
/etc/rc6.d/
That is all about day-6 in the Linux workshop. Thanks for reading my blog........
Subscribe to my newsletter
Read articles from Om Kadam directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
