Sec. 2 Processes Flashcards

1
Q

a program is a ……?

A

set of instructions, along with any internal data used while carrying in the instructions out.

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

a program may also use ….?

A

external data

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

what is a process?

A

a process is an executing program and associated resources .

  • including :
    • enviorment open files
    • signal handlers
    • etc…
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

when it comes to an everything is shared situtation with processes one speaks of …..?

A

multi-threaded process

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

In linux each thread of execution is considered …..?

A

individually

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

describe what a process is:

A

A process is an instance of an executing program .

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

every process has a ….?

A

process id or pid, a ppid or parent process id and a pgid (process group id)

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

every process also has ……?

A
  • program code
  • data
  • variables,
  • file descriptors
  • and an evironment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

init is usually the first _______ ?

A

process run ona system.

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

if the parent process dies before the child the ppid of the child is set to …..?

A

1

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

the child process which dies before its parent is known as a ….?

A

zombie process

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

Zombie processes have released all of their resoures and remain only to …..?

A

convey their exit status

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

processes are controlled by …..?

A

scheduling

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

Scheduling of processes is completely ….?

A

preemptive

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

All process have certain attributes . what are they?

A
  • the program being executed
  • context (state)
  • permissions
  • associated resources
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

every process is executing some …….?

A

program

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

explain what the context of a process is .

A

at any given moment , a process may taek a snapshot of itself by trapping the state of its CPU registers, where it is executing in the program, what is in the process’ memory and other information. this is the processs’ context

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

when a process started it is isolated in it own ______ ______ to protect is from other processes .

A

user space

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

do processes have direct acces to hardware?

A

no

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

Hardware is managed by the ……?

A

kernel

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

a process will have to use (what?) to indirectly access hardware

A

system calls

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

system calls are the fundamental interface between (what?) and the (what?)

A

application, kernel

23
Q

ulimit

A

ulimit is a built in bash command that displays or resets a number of resource limits associated with processes running under the shell.

24
Q

using ulimit how would see what is running?

A

ulimit -a

25
Q

when using ulimit there are two types of limits . what are they?

A
  1. hard

and

  1. soft
26
Q

define the hard limit:

A
  • the hard limit:
    • the maximum value , set only by the root user, that a user can raise the resource limit to .
    • example :
      • ulimit -H -n
27
Q

define the soft limit:

A
  • soft limit:
    • the current limiting value, which the user can modify, but cannot exeed the hard limit.
28
Q

what is the syntax of the command ulimit

A

ulimit [option] [limit]

29
Q

changes made with ulimit only affect the current shell if i want to make the changes effective for all users I would need to modify what file?

A

/etc/security/limits.conf

30
Q

processes can be one of several …….?

A

states

31
Q

define the process state : running

A
  • process state: running
    • the process is either currently executing on a CPU or CPU core or sittingin thr run queue, eargerly awaiting a new time slice.
    • it will resume running when the scheduler decides it is now deserving to occupy the CPU, or another CPU becomes idle
32
Q

du

A
  • Name:
    • du —- estimate file space usage
  • synopsis:
    • du – [option] … [file] …
  • Discription:
    • summarize disk usage of the set of files, recursively for directories .
33
Q

du –all

A

writes count ofr all files , not just directories.

34
Q

du –apparent-size

A

print apparent sizes , rather that disk usage; although the apparent size is usually smaller, it may be larger du to holes in files….

35
Q

du –c , –total

A

will produce a grand total of the disk summary usage

36
Q

du –d; –max-dept=N

A

print the total for a directory only if if is N or fewer levels below teh comand line arguement.

–max-depth=0 is the same as –summarize

–maxdepth=1: Just go down one level from / and sum up everything recursively underneath in the tree.

37
Q

du -h ; –human-readable

A

du’s output will print sizes in human readable format e.g. , 1k ,234 M…

38
Q

du –inodes

A

will list inode usage instead of block usuage

39
Q

du –time

A

show time of the last modification of any file in the directory, or any of it subdirectories

40
Q

du –X , –exclude-from=File

A

exclude files that match any pattern in File

41
Q

du -x ; –one-file-system

A

skip directories on different file systems

-x Stay on one filesystem ; don’t look at directories that are not on the / partition. In this case that means ignore: /dev /proc /run /sys

because these are pseudo-filesystems(/dev /proc /run /sys) which exist in memory only; they are just empty mount points when the system is not running.

42
Q

To obtain a full list of directories under / along with their size:

A

$ sudo du –max-depth=1 -hx /

43
Q

ulimit -S

A

-S , specifies the soft limit

44
Q

ulimit -H

A

-H , specifies the hard limit

45
Q

ps

A
  • Name: ps
    • ​ps - [options]
  • Discription:
    • ps displays information about a selection of the active processes
46
Q

ps -e

A

see every process on the system using standard syntax

47
Q

by default , ps selects all processes with the same effective _________ as the current user and associated with the same terminal as the invoker. .

A

user ID

48
Q

ps works by reading the _____________ ?

A

virtual files in /proc

49
Q

ps -o

option : cgroup

A

display control groups to which the process belongs

50
Q

ps -o

option : cgroup

A

display control groups to which the process belongs

51
Q

ps -o

option : cgname

A

display name of control groups to which the process belongs

52
Q

ps -o

option : c

A

processor utilization. Currently , this is teh integer value of the percent usage over the lifetime of the process

53
Q

ps -o

option : blocked

A

mask of the blocked signals. according to the width of teh field, a 32 or 64-bit mask in hexadecimal format is displayed

54
Q
A