Topic 10 – Services and daemons Flashcards

1
Q

this linux command will search the process list for the process named “galulator” and if there is a match will output its PID to the STDOUT

A

what is the outcome of typing the linux command

Pgrep “galculator”

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

this command will use the SIGKILL signal and the OS will terminate the process immediately

A

what is the outcome of typing the linux command

Kill -SIGKILL pid

or

Kill -9 pid

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

this will immediately stop the cron daemon

A

what is the outcome of typing the linux command

Sudo systemctl stop cron

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

what is the outcome of using the hotkey

Ctrl + z

in the linux terminal

A

this hotkey will suspend a process allowing it to be restarted at a later date

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

describe the process signal

SIGTERM

A

this will terminate a process and acts similarly to ending a process via the quit button provided

this can be caught or ignored by a process

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

while editing the crontable on exit this command will be added to the crontable and will run the command date >>/home/pi/date.log every 1 minute

A

while editing the cron table what is the outcome of adding this job

*/1 * * * * date >> /home/pi/date.log

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

this will display a list of processes/commands that are either running in the background or have been suspended

some deatils provided by the command are:

  • Job number
  • The jobs status such as running,suspended, terminated
  • The command that executed the process
A

what is the outcome of typing the linux command

jobs

and what 3 details does it provide

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

this will disable the cron daemon on the next reboot

(does not immediately stop the deamon)

A

what is the outcome of typing the linux command

Sudo systemctl disable cron

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

this linux command will search the process list for the process named “galulator” and if there is a match will output its PID and process name to the STDOUT

A

what is the outcome of typing the linux command

Pgrep -l “galculator”

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

what is the outcome of typing the linux command

Kill -SIGKILL pid

or

Kill -9 pid

A

this command will use the SIGKILL signal and the OS will terminate the process immediately

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

this will execute the command in the background and hand back control of the terminal to the user

A

what is the outcome of typing the linux command

Command &

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

this linux command will kill all processes that have a match with the name given

A

what is the linux command

Killall “process name”

used for

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

this can be achieved by sending a signal to the process or to the OS via the terminal

if the signal is sent to the process then it will be given the chance to end cleanly: saving any data and closing any of its elements correctly

if the signal is sent to the OS then the operating system may just end the process giving it no chance to end cleanly. this may be necessary if the above will not work

A

how can “out of control” processes be terminated within linux

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

these include:

  1. SIGINT
  2. SIGQUIT
  3. SIGILL
  4. SIGKILL
  5. SIGTERM
  6. SIGSTP
  7. SIGCONT
A

name 7 portable operating system intercae (POSIX) signals that may be sent to the OS or a process in order to terminate or suspend the process

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

what is the outcome of typing the linux command

Kill pid

A

this will use the SIGTERM signal and allow the procss given a chance to end cleanly, it is similar to pressing the close button on a GUI application

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

while making an entry to the cron table what is the outcome of using

*

in any of the time fields

A

while editing the time fields in the cron table this will denote that any value of this time type is valid for the time execution

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

while making an entry to the cron table what is the outcome of using

*/value

in any of the time fields

A

whileediting the cron table:

using this within any of the time fields will denote that the job should be executed at the given interval for that time type

example

  • every 1 minute
  • every 5 minute
  • every 5 day of week (every 5th day of the week)
  • every 6 hours
  • etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what is the outcome of typing the linux command

jobs

and what 3 details does it provide

A

this will display a list of processes/commands that are either running in the background or have been suspended

some deatils provided by the command are:

  • Job number
  • The jobs status such as running,suspended, terminated
  • The command that executed the process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

while editing the cron table what is the outcome of adding this job

*/1 * * * * date >> /home/pi/date.log

A

while editing the crontable on exit this command will be added to the crontable and will run the command date >>/home/pi/date.log every 1 minute

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

this command is used to edit the current crontab

A

what is the outcome of typing the linux command

Crontab -e

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

while inside the terminal:

this command can be used to start jobs running in the background that are in the jobs list

note

while the process is running in the background the terminal is free to execute further commands

A

what is the outcome of typing the linux command

bg %number of process in jobs list

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

these processes will usually have its name ending in a d or will include the word daemon within the process name

A

within linux how can a

daemon be differentiated from a normal process

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

these could be but are not limited to:

  • bluetooth
  • DHCP
  • task scheduler
A

name 3 types of background services

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

how can “out of control” processes be terminated within linux

A

this can be achieved by sending a signal to the process or to the OS via the terminal

if the signal is sent to the process then it will be given the chance to end cleanly: saving any data and closing any of its elements correctly

if the signal is sent to the OS then the operating system may just end the process giving it no chance to end cleanly. this may be necessary if the above will not work

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

what is the outcome of typing the linux command

Sudo systemctl stop cron

A

this will immediately stop the cron daemon

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

this will output the last few lines from the file located at ~/date.log

A

what is the outcome of typing the linux command

Tail ~/date.log

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

these are anything that is handled through the sytemd daemon and can perform a specific task

example units include:

  1. service
  2. device
  3. swap
A

in the context of systemd what are units and name 3 types

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

within the scope of systemd terminilogy

  • what is a daemon
  • what is a service
A

within the context of systemd

  1. a daemon is a type of service
  2. a service is a type of unit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

what is the outcome of using the hotkey

Ctrl + c

in the linux terminal

A

this hotkey will terminate a process

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

name 3 types of background services

A

these could be but are not limited to:

  • bluetooth
  • DHCP
  • task scheduler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

whileediting the cron table:

using this within any of the time fields will denote that the job should be executed at the given interval for that time type

example

  • every 1 minute
  • every 5 minute
  • every 5 day of week (every 5th day of the week)
  • every 6 hours
  • etc
A

while making an entry to the cron table what is the outcome of using

*/value

in any of the time fields

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

name 7 portable operating system intercae (POSIX) signals that may be sent to the OS or a process in order to terminate or suspend the process

A

these include:

  1. SIGINT
  2. SIGQUIT
  3. SIGILL
  4. SIGKILL
  5. SIGTERM
  6. SIGSTP
  7. SIGCONT
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

describe the process signal

SIGCONT

A

this will continue a process if it is stopped

this process signal may be used when the command

bg %number in jobs lists

or

fg %number in jobs lists

is used on a stopped process

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

what is the outcome of typing the linux command

Systemctl status cron

A

this will display the status of the cron daemon

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

what is the outcome of typing the linux command

Kill -l

A

this will display a list of signals provided by the os that may be used to terminate or pause a process

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

describe the process signal

SIGINT

A

this will terminate a process and is the same signal that is sued by the hotkey ctrl + c

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

this will enable the cron daemon on the next reboot

(does not immeditaely start the cron daemon)

A

what is the outcome of typing the linux command

Sudo systemctl enable cron

38
Q

while inside the terminal:

this command can be used to bring jobs that are in the jobs list to the foreground

note

running new commands or processes is not possible until the current process has finished

A

what is the outcome of typing the linux command

Fg %number of process in jobs list

39
Q

while editing the time fields in the cron table this will denote that any value of this time type is valid for the time execution

A

while making an entry to the cron table what is the outcome of using

*

in any of the time fields

40
Q

what is the outcome of typing the linux command

Tail ~/date.log

A

this will output the last few lines from the file located at ~/date.log

41
Q

what is a

service or daemon

A

these are background processes that provide services to the OS and the user

most will be started at boot time and will keep running for the lifetime of the OS unless explicitly stopped

42
Q

this linux command known as system control can be used to control the systemmd as well as services

A

what is the linux command

systemctl

used for

43
Q

this hotkey will terminate a process

A

what is the outcome of using the hotkey

Ctrl + c

in the linux terminal

44
Q

describe the process signal

SIGKILL

A

this will terminate a process

this signal is sent only to the OS

it cannot be caught or ignored by a process

45
Q

what is the outcome of typing the linux command

Command &

A

this will execute the command in the background and hand back control of the terminal to the user

46
Q

this will display a list of signals provided by the os that may be used to terminate or pause a process

A

what is the outcome of typing the linux command

Kill -l

47
Q

these are background processes that provide services to the OS and the user

most will be started at boot time and will keep running for the lifetime of the OS unless explicitly stopped

A

what is a

service or daemon

48
Q

this itself is a daemon that is started by the kernel at boot time

it is responsible for handling what are known as units

one such unit is a service and a daemon is a type of service

A

what is

systemd

within linux

49
Q

this will display all processes that are associated with the user, regardless of the terminal they were started in

A

what is the outcome of typing the linux command

ps -x

50
Q

this will terminate a process

this signal is sent only to the OS

it cannot be caught or ignored by a process

A

describe the process signal

SIGKILL

51
Q

this will stop or pause a process so that it can be continued later

this is also the process signal used by the hotkey ctrl + z

A

describe the process signal

SIGSTP

52
Q

within the context of systemd

  1. a daemon is a type of service
  2. a service is a type of unit
A

within the scope of systemd terminilogy

  • what is a daemon
  • what is a service
53
Q

what is the outcome of typing the linux command

Sudo systemctl enable cron

A

this will enable the cron daemon on the next reboot

(does not immeditaely start the cron daemon)

54
Q

this will continue a process if it is stopped

this process signal may be used when the command

bg %number in jobs lists

or

fg %number in jobs lists

is used on a stopped process

A

describe the process signal

SIGCONT

55
Q

this will output the last few lines of the file located at ~/date.log and continue to give output as the file grows

A

what is the outcome of typing the linux command

Tail -f ~/date.log

56
Q

what is the linux command

pgrep

used for

A

this command can be used to search through the currently running processes by name and any matches will be sent to the STDOUT

57
Q

this hotkey will suspend a process allowing it to be restarted at a later date

A

what is the outcome of using the hotkey

Ctrl + z

in the linux terminal

58
Q

what is the outcome of typing the linux command

Pgrep -l “galculator”

A

this linux command will search the process list for the process named “galulator” and if there is a match will output its PID and process name to the STDOUT

59
Q

this command will delay a process for a given amount of time

A

what is the outcome of typing the linux command

Sleep seconds

60
Q

what is the outcome of typing the linux command

Fg %number of process in jobs list

A

while inside the terminal:

this command can be used to bring jobs that are in the jobs list to the foreground

note

running new commands or processes is not possible until the current process has finished

61
Q

what is the linux command

tail

used for

A

this is a command that can output the last few lines of a file

62
Q

what is the outcome of typing the linux command

Sleep seconds

A

this command will delay a process for a given amount of time

63
Q

in the context of systemd what are units and name 3 types

A

these are anything that is handled through the sytemd daemon and can perform a specific task

example units include:

  1. service
  2. device
  3. swap
64
Q

describe the process signal

SIGSTP

A

this will stop or pause a process so that it can be continued later

this is also the process signal used by the hotkey ctrl + z

65
Q

this will use the SIGTERM signal and allow the procss given a chance to end cleanly, it is similar to pressing the close button on a GUI application

A

what is the outcome of typing the linux command

Kill pid

66
Q

this will list all systemmd units that are of type service

A

what is the outcome of typing the linux command

Systemctl list-units –type=service

67
Q

what is the outcome of typing the linux command

Sudo systemctl disable cron

A

this will disable the cron daemon on the next reboot

(does not immediately stop the deamon)

68
Q

what is the outcome of typing the linux command

Crontab -e

A

this command is used to edit the current crontab

69
Q

this will terminate a process and acts similarly to ending a process via the quit button provided

this can be caught or ignored by a process

A

describe the process signal

SIGTERM

70
Q

this will terminate a process and is the same signal that is sued by the hotkey ctrl + c

A

describe the process signal

SIGINT

71
Q

what is the outcome of typing the linux command

Tail -f ~/date.log

A

this will output the last few lines of the file located at ~/date.log and continue to give output as the file grows

72
Q

the format to create this is as follows:

Minute - hour - day_of_month - month - day_of_week - command

  • denotes a space
A

what is the format to create a new cronjob

73
Q

this is a command that can output the last few lines of a file

A

what is the linux command

tail

used for

74
Q

what is the outcome of typing the linux command

Systemctl list-units –type=service

A

this will list all systemmd units that are of type service

75
Q

within linux how can a

daemon be differentiated from a normal process

A

these processes will usually have its name ending in a d or will include the word daemon within the process name

76
Q

what is the linux command

systemctl

used for

A

this linux command known as system control can be used to control the systemmd as well as services

77
Q

This is a daemon that is intended to be used directly by the end user and is found on all unix-like systems

This is used to create jobs that can be scheduled to run in the background at given time intervals

A

within linux what is the

cron daemon

78
Q

what is the outcome of typing the linux command

ps -x

A

this will display all processes that are associated with the user, regardless of the terminal they were started in

79
Q

within linux what is the

cron daemon

A

This is a daemon that is intended to be used directly by the end user and is found on all unix-like systems

This is used to create jobs that can be scheduled to run in the background at given time intervals

80
Q

what is the format to create a new cronjob

A

the format to create this is as follows:

Minute - hour - day_of_month - month - day_of_week - command

  • denotes a space
81
Q

what is the outcome of typing the linux command

Sudo systemctl start cron

A

this will immediately start the cron daemon

82
Q

what is the outcome of typing the linux command

Pgrep “galculator”

A

this linux command will search the process list for the process named “galulator” and if there is a match will output its PID to the STDOUT

83
Q

this is a command that can be used to view all running processes in a tree like format

A

what is the outcome of typing the linux command

pstree

84
Q

this will display the status of the cron daemon

A

what is the outcome of typing the linux command

Systemctl status cron

85
Q

what is the outcome of typing the linux command

Kill %number of process in jobs list

A

this will terminate the given job number that is in the jobs list

86
Q

what is the outcome of typing the linux command

pstree

A

this is a command that can be used to view all running processes in a tree like format

87
Q

this will immediately start the cron daemon

A

what is the outcome of typing the linux command

Sudo systemctl start cron

88
Q

this will terminate the given job number that is in the jobs list

A

what is the outcome of typing the linux command

Kill %number of process in jobs list

89
Q

what is the outcome of typing the linux command

bg %number of process in jobs list

A

while inside the terminal:

this command can be used to start jobs running in the background that are in the jobs list

note

while the process is running in the background the terminal is free to execute further commands

90
Q

what is the linux command

Killall “process name”

used for

A

this linux command will kill all processes that have a match with the name given

91
Q

this command can be used to search through the currently running processes by name and any matches will be sent to the STDOUT

A

what is the linux command

pgrep

used for

92
Q

what is

systemd

within linux

A

this itself is a daemon that is started by the kernel at boot time

it is responsible for handling what are known as units

one such unit is a service and a daemon is a type of service