Topic 10 – Services and daemons Flashcards

(92 cards)

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
what is the outcome of typing the linux command **Sudo systemctl stop** *cron*
this will immediately stop the cron daemon
26
this will output the last few lines from the file located at ~/date.log
what is the outcome of typing the linux command **Tail** *~/date.log*
27
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
in the context of systemd what are units and name 3 types
28
within the scope of systemd terminilogy * what is a daemon * what is a service
within the context of systemd 1. a daemon is a type of service 2. a service is a type of unit
29
what is the outcome of using the hotkey **Ctrl + c** in the linux terminal
this hotkey will terminate a process
30
name 3 types of background services
these could be but are not limited to: * bluetooth * DHCP * task scheduler
31
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
while making an entry to the cron table what is the outcome of using **\*/***value* in any of the time fields
32
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
these include: 1. SIGINT 2. SIGQUIT 3. SIGILL 4. SIGKILL 5. SIGTERM 6. SIGSTP 7. SIGCONT
33
describe the process signal ## Footnote **SIGCONT**
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
34
what is the outcome of typing the linux command **Systemctl status** *cron*
this will display the status of the cron daemon
35
what is the outcome of typing the linux command ## Footnote **Kill -l**
this will display a list of signals provided by the os that may be used to terminate or pause a process
36
describe the process signal ## Footnote **SIGINT**
this will terminate a process and is the same signal that is sued by the hotkey ctrl + c
37
this will enable the cron daemon on the next reboot (does not immeditaely start the cron daemon)
what is the outcome of typing the linux command **Sudo systemctl enable** *cron*
38
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
what is the outcome of typing the linux command **Fg %***number of process in jobs list*
39
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
while making an entry to the cron table what is the outcome of using **\*** in any of the time fields
40
what is the outcome of typing the linux command **Tail** *~/date.log*
this will output the last few lines from the file located at ~/date.log
41
what is a ## Footnote **service or daemon**
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
this linux command known as system control can be used to control the systemmd as well as services
what is the linux command **systemctl** used for
43
this hotkey will terminate a process
what is the outcome of using the hotkey **Ctrl + c** in the linux terminal
44
describe the process signal ## Footnote **SIGKILL**
this will terminate a process this signal is sent only to the OS it cannot be caught or ignored by a process
45
what is the outcome of typing the linux command *Command* **&**
this will execute the command in the background and hand back control of the terminal to the user
46
this will display a list of signals provided by the os that may be used to terminate or pause a process
what is the outcome of typing the linux command ## Footnote **Kill -l**
47
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
what is a ## Footnote **service or daemon**
48
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
what is **systemd** within linux
49
this will display all processes that are associated with the user, regardless of the terminal they were started in
what is the outcome of typing the linux command ## Footnote **ps -x**
50
this will terminate a process this signal is sent only to the OS it cannot be caught or ignored by a process
describe the process signal ## Footnote **SIGKILL**
51
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
describe the process signal ## Footnote **SIGSTP**
52
within the context of systemd 1. a daemon is a type of service 2. a service is a type of unit
within the scope of systemd terminilogy * what is a daemon * what is a service
53
what is the outcome of typing the linux command **Sudo systemctl enable** *cron*
this will enable the cron daemon on the next reboot (does not immeditaely start the cron daemon)
54
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
describe the process signal ## Footnote **SIGCONT**
55
this will output the last few lines of the file located at ~/date.log and continue to give output as the file grows
what is the outcome of typing the linux command **Tail -f** *~/date.log*
56
what is the linux command **pgrep** used for
this command can be used to search through the currently running processes by name and any matches will be sent to the STDOUT
57
this hotkey will suspend a process allowing it to be restarted at a later date
what is the outcome of using the hotkey **Ctrl + z** in the linux terminal
58
what is the outcome of typing the linux command **Pgrep -l** **“galculator”**
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
this command will delay a process for a given amount of time
what is the outcome of typing the linux command **Sleep** *seconds*
60
what is the outcome of typing the linux command **Fg %***number of process in jobs list*
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
what is the linux command **tail** used for
this is a command that can output the last few lines of a file
62
what is the outcome of typing the linux command **Sleep** *seconds*
this command will delay a process for a given amount of time
63
in the context of systemd what are units and name 3 types
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
describe the process signal ## Footnote **SIGSTP**
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
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
what is the outcome of typing the linux command **Kill** *pid*
66
this will list all systemmd units that are of type service
what is the outcome of typing the linux command **Systemctl list-units --type=***service*
67
what is the outcome of typing the linux command **Sudo systemctl disable** *cron*
this will disable the cron daemon on the next reboot (does not immediately stop the deamon)
68
what is the outcome of typing the linux command ## Footnote **Crontab -e**
this command is used to edit the current crontab
69
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
describe the process signal ## Footnote **SIGTERM**
70
this will terminate a process and is the same signal that is sued by the hotkey ctrl + c
describe the process signal ## Footnote **SIGINT**
71
what is the outcome of typing the linux command **Tail -f** *~/date.log*
this will output the last few lines of the file located at ~/date.log and continue to give output as the file grows
72
the format to create this is as follows: ## Footnote Minute - hour - day\_of\_month - month - day\_of\_week - command - denotes a space
what is the format to create a new cronjob
73
this is a command that can output the last few lines of a file
what is the linux command **tail** used for
74
what is the outcome of typing the linux command **Systemctl list-units --type=***service*
this will list all systemmd units that are of type service
75
within linux how can a ## Footnote **daemon be differentiated from a normal process**
these processes will usually have its name ending in a d or will include the word daemon within the process name
76
what is the linux command **systemctl** used for
this linux command known as system control can be used to control the systemmd as well as services
77
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
within linux what is the ## Footnote **cron daemon**
78
what is the outcome of typing the linux command ## Footnote **ps -x**
this will display all processes that are associated with the user, regardless of the terminal they were started in
79
within linux what is the ## Footnote **cron daemon**
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
what is the format to create a new cronjob
the format to create this is as follows: ## Footnote Minute - hour - day\_of\_month - month - day\_of\_week - command - denotes a space
81
what is the outcome of typing the linux command **Sudo systemctl start** *cron*
this will immediately start the cron daemon
82
what is the outcome of typing the linux command **Pgrep** **“galculator”**
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
this is a command that can be used to view all running processes in a tree like format
what is the outcome of typing the linux command ## Footnote **pstree**
84
this will display the status of the cron daemon
what is the outcome of typing the linux command **Systemctl status** *cron*
85
what is the outcome of typing the linux command **Kill %***number of process in jobs list*
this will terminate the given job number that is in the jobs list
86
what is the outcome of typing the linux command ## Footnote **pstree**
this is a command that can be used to view all running processes in a tree like format
87
this will immediately start the cron daemon
what is the outcome of typing the linux command **Sudo systemctl start** *cron*
88
this will terminate the given job number that is in the jobs list
what is the outcome of typing the linux command **Kill %***number of process in jobs list*
89
what is the outcome of typing the linux command **bg %***number of process in jobs list*
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
what is the linux command **Killall** *“process name”* used for
this linux command will kill all processes that have a match with the name given
91
this command can be used to search through the currently running processes by name and any matches will be sent to the STDOUT
what is the linux command **pgrep** used for
92
what is **systemd** within linux
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