03 Flashcards

(39 cards)

1
Q

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

A

Fork

Wait

execve

exit
kill(sig, PID)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

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

A

creat

open

close

read

write

ioctl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

System calls for information management

___ returns the PID of the calling process

_____ returns system information pertaining to the platform

A

getpid

uname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

pipe

mmap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

System calls for protection

____ sets the calling process’ file mode creation mask (umask) to mask

____ changes a file’s mode bits

A

umask

chmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The _______ command allows you to diagnose and debug programs when the source code is unavailable

A

strace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does
Strace -c /bin/hostname do?

strace -e open /bin/hostname

strace -o /tmp/my.lstrace /bin/hostname

A

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?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The _____ command lists currently loaded/active kernel modules

A

lsmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The ______ command provides an interface to allow viewing and changing of kernel parameters

A

sysctl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

sysctl -a (all)

sysctl -w (write)

sysctl -p (persistent)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The _____ command sets or prints limits imposed on files written by the shell and its child processes

A

ulimit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does each option do for the ulimit command?

ulimit -a

ulimit -c <value></value>

ulimit -u <value></value>

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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)

A

foreground

background

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain how a process works?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the different process states in a
ps -elf ouput?

r ______-_____________

s ______-_____________

z ______-_____________

t ______-_____________

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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,

A

Interrupt

Trap

16
Q

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

A

Terminal

Administrator

Kernel

17
Q

The _______ command displays all signals available

18
Q

What are common Linux file systems?

4

A

EXT3
EXT4
XFS
EXT(X)

19
Q

What are commo ndistributed network file systems?

2

20
Q

What are common virtual file systems?

3

A

swapfs
procfs
tmpfs

21
Q

_______ lets you view the disks physical partioning scheme

22
Q

The _____ command reveals all linux file systems, disk space usage, and logical mount points in blocks

23
Q

What does each option for the df command do?

df -h
df-m
df -k

A

View the output in human readable format

read output in megabytes

read output in kilobytes

24
The ________ journaling file system is based on older unix file systems, this file maintains a journal used to repair inconsistencies that may occur after an improper shutdown
EXT(X)
25
An ext __________ is located 1024 bytes from the start of the file system
superblock
26
The __________ command prints the superblock and block group information for the file system
dumpe2fs
27
A data ________ is the basic file allocation unit of EXT and is used to store file content
block
28
The metadata for each file is stored in a data structure called an _______
inode
29
The _____________________ list the blocks on the disk where the data is stored
inode table of contents
29
A ___________ is a simple data structure contain filename and inode address where the file's metadata can be found. It also contains a pointer to the next entry.
directory entry
30
The ________ command is used to view file or file system status to include timestamps
stat
31
the __________ command is used to change the timestamps on a file. As a secondary function, it can also create an empty file.
touch
32
What does each option for the touch command do? touch -t 201706270904 a.txt
updates the timestamp
33
The allocation status of inodes is determined using the block group’s __________
inode bitmap
34
A ________ is a pointer to a file's inode and is the same as the original file.
hard link
35
A ________ is a file containing the pathname of another file. With a symbolic link, a file's contents are accessed through the pathname
symbolic link
36
What command maps a logical device to mountpoints on a file system and displayus a list of mounted file systems.
mount
37