03 Flashcards
(39 cards)
What are the system calls for process control?
_____ Used to create a child process in the image of the parent process
_____ blocks the calling process until its child process exits or signal is recieved
_____ executes the program pointed to by filename, an executable or a script
_____ termionates the current process and performs a cleanup afterwards
_______ sends a signal to another process to terminate it
Fork
Wait
execve
exit
kill(sig, PID)
System calls for file or device management (Input/output):
_____ creates and opens a file
____ opens existing file/device
____ closes all files associated with terminating process
___ reads data from a file/device
____ writes data to a file/device
_____ input/ouput control of device-specific operations
creat
open
close
read
write
ioctl
System calls for information management
___ returns the PID of the calling process
_____ returns system information pertaining to the platform
getpid
uname
System calls for communication
_____ creates a unidirectional data channel used for inter-process communication (IPC)
______ creates a new mapping in the virtual address space of the calling process
pipe
mmap
System calls for protection
____ sets the calling process’ file mode creation mask (umask) to mask
____ changes a file’s mode bits
umask
chmod
The _______ command allows you to diagnose and debug programs when the source code is unavailable
strace
What does
Strace -c /bin/hostname do?
strace -e open /bin/hostname
strace -o /tmp/my.lstrace /bin/hostname
Let’s you oversee an overview of system calls /bin/hostanme made during it’s execution
Let’s you look for specific systemcalls made by the /bin/hostname application
Let’s you paste the output of the strace to another file?
The _____ command lists currently loaded/active kernel modules
lsmod
The ______ command provides an interface to allow viewing and changing of kernel parameters
sysctl
sysctl -a (all)
sysctl -w (write)
sysctl -p (persistent)
lists all the kernel parameters and their settings
lets you make edits to the Kernel settings with the changes being lost on reboot
Let’s you make changes and save them after reboot
The _____ command sets or prints limits imposed on files written by the shell and its child processes
ulimit
What does each option do for the ulimit command?
ulimit -a
ulimit -c <value></value>
ulimit -u <value></value>
displays limits imposed on resources avaliable to the current shell
(core) displays or sets core file size. If set to zero (0) core dumps are not allowed. Therefore if the process aborts there is no debugging
Displays or sets max number of processes per user
What are the two types of procceses?
_______ is interactive and started by a user, as opposed to automatically started at boot time
_______ is non-interactive, does not need user input (e.g. gnome terminal)
foreground
background
Explain how a process works?
The process forks() itself, original becoming a parent and the copy the child. The two become separate processes and the child will take care of a specific job while the parent will keep doing the main task. when the child finishes it requests an exit() while waiting for the parent to recognize that exit it becomes a zombie not taking up any resources but waiting for conformation
What are the different process states in a
ps -elf ouput?
r ______-_____________
s ______-_____________
z ______-_____________
t ______-_____________
running- Running or runnable (in run queue)
Sleeping - Waiting for some resource or event to occur (uninterruptable sleep)
Zombie- Dead process whose process table entry still exists
Stopped - Suspended process (not allowed to execute)
A Process interruption or event may occur in one of two ways
___________ A signal generated by the hardware when it wants the processors attiention. only need a short period of CPU time and afterwards the original process resumes execution
___________ Software written to catch an exception generated by the CPU. Used to handle interruptions and exceptions,
Interrupt
Trap
Signals are process-level interrupt requests that can be sent in one of three ways
________ CTRL + C and CTRL + D to kill, interrupt, or suspend a process
________ with a kill or pkill command to get the desired results
_______ When a process commits an infraction such as division by zero
Terminal
Administrator
Kernel
The _______ command displays all signals available
kill -l
What are common Linux file systems?
4
EXT3
EXT4
XFS
EXT(X)
What are commo ndistributed network file systems?
2
NFS
SMB
What are common virtual file systems?
3
swapfs
procfs
tmpfs
_______ lets you view the disks physical partioning scheme
fdisk -1
The _____ command reveals all linux file systems, disk space usage, and logical mount points in blocks
df
What does each option for the df command do?
df -h
df-m
df -k
View the output in human readable format
read output in megabytes
read output in kilobytes