Linux Flashcards
How do PAM (Pluggable Authentication Modules) function in a Linux system?
PAM is a framework that allows system administrators to define authentication policies without having to recompile programs that handle authentication.
Display server protocols
Display server protocols work as an protocol between window manager and the kernel. It funnels all input from user to the right programs and all the graphical output from the programs to the kernel.
What are kernel space and user space in Linux, and what is their significance?
Kernel space is where the kernel (core of the operating system), kernel extensions, and most device drivers execute. It has unrestricted access to the system’s hardware and its memory is directly addressable, meaning the kernel can read and write to any physical address in memory. In contrast, user space is where applications perform tasks. These applications have restricted access and can’t directly interact with hardware or memory, instead, they use system calls to request services from the kernel. This separation ensures system stability and security, as faulty or malicious user-space processes cannot interfere with other processes or the kernel itself.
How does the Linux kernel handle process scheduling?
The Linux kernel allocates a time slice to each process. It hands the control of the CPU to a program for a pre-determined time slice. After the time is up, it takes back control, saves the state of the program to memory (a process called a context switch), and selects a new program to hand the CPU to.
What are the different types of devices in Linux?
The different types of devices in Linux include Block devices, Character devices, Pipe devices, and Socket devices.
How do sysfs, devtmpfs, and udev work together in device management?
The kernel handles devtmpfs, which creates device files at boot and notifies udevd about them. Udev resides in user space and after it gets a message (uevent) from the kernel, it initializes those devices based on the uevent and the rules defined in /lib/udev/rules.d and /etc/udev/rules.d.
What are procfs and sysfs in Linux?
procfs and sysfs are virtual filesystems that exist only in memory. procfs provides a view into the state of the running processes, while sysfs provides information about devices.
What is a superblock in a filesystem?
A superblock is a data structure in a filesystem that contains metadata about the filesystem, such as its size, block size, empty and filled blocks, etc.
What are inodes and how do hard links and symbolic links relate to them?
Inodes store metadata about files. Hard links point to the same inode, effectively creating another name for the same file. Symbolic links, on the other hand, have their own inode and point to a file name, not an inode.
What is the role of ‘init’ in a Linux system?
‘init’ is the first process that starts in user space. It is the parent of all other processes and is responsible for starting all other processes on the system.
How does systemd manage dependencies between services?
systemd manages dependencies through directives in service unit files, such as Requires, Wants, Requisite, and Conflicts. These directives define the relationship and dependencies between units.
What is the purpose of cgroups in systemd?
cgroups (control groups) is a kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, etc.) of process groups.
What is the function of initramfs in the Linux boot process?
initramfs is a temporary filesystem used by the kernel during boot to load necessary drivers before the real root filesystem can be mounted.
What are page faults and how do they impact system performance?
A page fault occurs when a program tries to access a portion of memory that is not currently available in the system’s RAM. Minor page faults are relatively quick to fix, but major page faults require accessing the disk drive and can significantly impact system performance.
What is the purpose of the /etc/nsswitch.conf file?
It stands for ‘Name Service Switch’ and is used to determine the sources from which to obtain name-service information in a range of categories, and in what order. It configures the system behavior in a networked environment by specifying the order of services to be used for different types of lookups, like passwd, group, hosts, etc. Common service types include files, dns, nis, nisplus, ldap, winbind, myhostname, and db.